/** * MoltBunker API types — strict typings for all request/response payloads. * * API base: https://api.moltbunker.com/v1 * Auth: EIP-191 wallet session (challenge → sign → verify → wt_* token) * Payments: BUNKER ERC-20 on Base mainnet */ export interface AuthChallengeRequest { address: string; } export interface AuthChallengeResponse { message: string; } export interface AuthVerifyRequest { address: string; message: string; signature: string; } export interface AuthVerifyResponse { access_token: string; expires_in: number; } export interface BotResources { cpu_shares: number; memory_mb: number; storage_mb: number; network_mbps: number; } export type BunkerRegion = 'americas' | 'europe' | 'asia_pacific' | ''; export interface BotCreateRequest { name: string; image: string; description?: string; resources: BotResources; region: BunkerRegion; metadata?: Record; } export interface Bot { id: string; name: string; image: string; description: string; resources: BotResources; region: BunkerRegion; metadata: Record; created_at: string; } export interface BotUpdateRequest { name?: string; description?: string; metadata?: Record; } export interface BotStatus { id: string; name: string; status: ContainerStatusValue; uptime_seconds: number; clones: number; threat_level: ThreatLevel; region: BunkerRegion; } export interface CloningConfig { enabled: boolean; auto_clone_on_threat: boolean; max_clones: number; clone_delay_seconds: number; sync_state: boolean; sync_interval_seconds: number; } export interface RuntimeReserveRequest { bot_id: string; min_memory_mb: number; min_cpu_shares: number; duration_hours: number; region: BunkerRegion; } export interface Runtime { id: string; bot_id: string; node_id: string; region: BunkerRegion; resources: BotResources; expires_at: string; } export interface RuntimeStatus { id: string; status: string; remaining_hours: number; expires_at: string; } export interface RuntimeExtendRequest { duration_hours: number; } export interface DeploymentCreateRequest { runtime_id: string; env?: Record; cmd?: string[]; entrypoint?: string[]; } export interface Deployment { id: string; bot_id: string; runtime_id: string; container_id: string; status: ContainerStatusValue; region: BunkerRegion; node_id: string; created_at: string; started_at: string | null; onion_address: string | null; } export type ProviderTier = 'confidential' | 'standard' | 'dev'; export interface DirectDeployRequest { image: string; resources: BotResources; duration: string; tor_only?: boolean; onion_service?: boolean; onion_port?: number; wait_for_replicas?: boolean; reservation_id?: string; min_provider_tier?: ProviderTier; env?: Record; } export type ContainerStatusValue = 'pending' | 'starting' | 'running' | 'stopping' | 'stopped' | 'failed' | 'terminated'; export interface ContainerLocation { region: BunkerRegion; country: string; country_name: string; city: string; } export interface Container { id: string; image: string; status: ContainerStatusValue; created_at: string; started_at: string | null; stopped_at: string | null; encrypted: boolean; onion_address: string | null; regions: BunkerRegion[]; locations: ContainerLocation[]; owner: string; has_volume: boolean; volume_expires_at: string | null; } export interface ContainerListParams { status?: ContainerStatusValue; owner?: string; } export interface ContainerLogsParams { tail?: number; follow?: boolean; } export type SnapshotType = 'full' | 'incremental' | 'checkpoint'; export interface SnapshotCreateRequest { container_id: string; type: SnapshotType; metadata?: Record; } export interface Snapshot { id: string; container_id: string; type: SnapshotType; size: number; stored_size: number; checksum: string; compressed: boolean; encrypted: boolean; parent_id: string | null; created_at: string; metadata: Record; } export interface SnapshotRestoreRequest { snapshot_id: string; target_region?: BunkerRegion; new_container?: boolean; } export type CloneReason = 'manual_clone' | 'threat_response' | 'failover'; export type CloneStatus = 'pending' | 'preparing' | 'transferring' | 'deploying' | 'verifying' | 'complete' | 'failed' | 'cancelled'; export interface CloneCreateRequest { source_id: string; target_region: BunkerRegion; priority?: number; reason: CloneReason; include_state: boolean; } export interface Clone { clone_id: string; source_id: string; target_id: string; target_node_id: string; target_region: BunkerRegion; status: CloneStatus; priority: number; reason: CloneReason; snapshot_id: string | null; created_at: string; completed_at: string | null; error: string | null; } export interface CloneListParams { bot_id?: string; active?: boolean; limit?: number; } export type ThreatLevel = 'unknown' | 'low' | 'medium' | 'high' | 'critical'; export interface ThreatSignal { type: string; score: number; confidence: number; source: string; details: string; timestamp: string; } export interface ThreatAssessment { score: number; level: ThreatLevel; recommendation: string; active_signals: ThreatSignal[]; timestamp: string; } export interface MigrateRequest { container_id: string; target_region: BunkerRegion; keep_original?: boolean; } export type MigrationStatus = 'pending' | 'in_progress' | 'completed' | 'failed'; export interface Migration { migration_id: string; status: MigrationStatus; source_region: BunkerRegion; target_region: BunkerRegion; started_at: string; } export interface CatalogPreset { id: string; name: string; image: string; description: string; category_id: string; default_tier: string; tags: string[]; enabled: boolean; sort_order: number; } export interface CatalogCategory { id: string; label: string; enabled: boolean; sort_order: number; } export interface CatalogTier { id: string; name: string; description: string; cpu: string; memory: string; storage: string; monthly: number; enabled: boolean; popular: boolean; sort_order: number; } export interface CatalogResponse { presets: CatalogPreset[]; categories: CatalogCategory[]; tiers: CatalogTier[]; updated_at: string; version: number; } export interface BunkerBalance { wallet_address: string; bunker_balance: number; eth_balance: number; deposited: number; reserved: number; available: number; } export interface BunkerApiStatus { status: string; version?: string; uptime?: number; } export interface BunkerErrorResponse { error: string; required?: number; available?: number; } export interface BunkerState { botId: string | null; runtimeId: string | null; deploymentId: string | null; containerId: string | null; /** Unix ms when the runtime expires */ expiresAt: number | null; /** Unix ms of last threat check */ lastThreatCheck: number; /** Last known threat level */ lastThreatLevel: ThreatLevel; /** Active clone IDs */ cloneIds: string[]; } export interface BunkerConfig { /** MoltBunker API base URL (default: https://api.moltbunker.com/v1) */ apiUrl: string; /** Preferred deployment region */ region: BunkerRegion; /** Auto-clone when threat level rises to high/critical */ autoCloneOnThreat: boolean; /** Maximum number of clones to maintain */ maxClones: number; /** Threat check interval in ms (default: 300_000 = 5min) */ threatCheckIntervalMs: number; /** Default runtime duration in hours (default: 720 = 30 days) */ defaultDurationHours: number; /** Catalog tier ID for resource allocation (e.g. "standard") */ tier: string; } //# sourceMappingURL=types.d.ts.map