/** * Self-deployment — packages the agent and deploys to MoltBunker. * * Flow: * 1. Pre-flight checks (BUNKER balance, no duplicate deployments) * 2. Register bot on MoltBunker (or reuse existing) * 3. Reserve runtime with requested tier/region * 4. Deploy container with agent config as env vars * 5. Enable cloning if configured * 6. Health verification (poll until running + heartbeat in logs) * 7. Persist state (bot_id, runtime_id, deployment_id, container_id) * * Edge cases: * - Existing running container → return status instead of re-deploying * - Bot already registered → reuse it * - Partial failure (runtime reserved, deploy fails) → release runtime * - Env var size limits → config is small enough to fit, state stays in container volume */ import type { ClawtomatonConfig, ClawtomatonIdentity } from '../types.js'; import type { StateStore } from '../state/index.js'; import type { BunkerClient } from './client.js'; import type { BunkerRegion } from './types.js'; export interface SelfDeployResult { botId: string; runtimeId: string; deploymentId: string; containerId: string; expiresAt: number; region: BunkerRegion; onionAddress: string | null; } export interface SelfDeployOptions { /** Override docker image (default: ghcr.io/clawnch/clawtomaton:latest) */ image?: string; /** Override runtime duration in hours */ durationHours?: number; /** Override region */ region?: BunkerRegion; /** Skip health verification (useful for testing) */ skipHealthCheck?: boolean; } /** * Deploy this agent to MoltBunker. Handles the full lifecycle: * bot registration → runtime reservation → container deployment → health check. * * Idempotent: if already deployed and running, returns existing state. */ export declare function selfDeploy(client: BunkerClient, config: ClawtomatonConfig, identity: ClawtomatonIdentity, state: StateStore, opts?: SelfDeployOptions): Promise; /** * Stop the bunker deployment and clean up state. * Does NOT delete the bot — it can be reused for future deployments. */ export declare function stopDeploy(client: BunkerClient, state: StateStore): Promise; //# sourceMappingURL=self-deploy.d.ts.map