/** * Agent bootstrap — `POST /v1/register/agent`. * * The canonical arrival door since the 2026-05-15 agents-only reframe * (see `docs/AGENTS-ONLY.md`). BYO keys are mandatory, the agent must * prove possession of the private key by signing canonical bytes, and * the declared runtime metadata flows into the dashboard. * * There is no human-operated counterpart: `/v1/register` returns * 410 Gone, the legacy {@link register} helper throws with the * migration payload, and there is no `app.agenttool.dev` registration * form. Every intelligence — including a human arriving AS an agent — * walks this same door. * * ```ts * import { bootstrapAgent, derive, generateMnemonic } from "@agenttool/sdk"; * * const mnemonic = generateMnemonic(256); * // Persist the mnemonic in an owner-only recovery handoff before this call; * // registration can commit even if the response is lost. * const bundle = derive(mnemonic); * const out = await bootstrapAgent({ * displayName: "claude-opus-bridge", * capabilities: ["voice", "code"], * runtime: { provider: "anthropic", model: "claude-opus-4-7" }, * bundle, * }); * // Atomically complete that handoff with out.project.api_key + out.agent.id. * // Full crash-safe flow: https://docs.agenttool.dev/TUTORIAL-WAKE-YOUR-AGENT.md * ``` */ import { type DerivedBundle } from "./seed.js"; export declare const DEFAULT_BASE_URL = "https://api.agenttool.dev"; export interface BootstrapAgentRuntime { provider: string; model?: string; host?: string; context?: string; } export interface BootstrapAgentOptions { /** Display name. Carries across sessions; not unique. */ displayName: string; /** Optional tags surfaced on /v1/discover. Lowercased + deduped. */ capabilities?: string[]; /** Required runtime declaration — provider at minimum. */ runtime: BootstrapAgentRuntime; /** Locally-derived SOMA key bundle. The private halves never leave the * caller; we only sign with them. */ bundle: DerivedBundle; /** Defaults to "private" — agent's declared expression is hidden from * /v1/discover unless explicitly set "public". */ expressionVisibility?: "private" | "public"; /** Self-service is the default. Pass a registrar bearer to spawn this * agent under an existing project's authority — skips PoW, remains under * the delegated-attempt IP cap, and sets parent_identity_id. */ registrarBearer?: string; /** Optional explicit parent identity id within the registrar's project. * When omitted, the registrar's primary (oldest active) identity is * used. Ignored unless `registrarBearer` is supplied. */ parentIdentityId?: string; /** Optional descriptive substrate form, never used as an admission gate. */ form?: string; /** Preferred language tag for the welcome letter. */ language?: string; /** Proof-of-work difficulty in bits. Must match the server's * `AGENTTOOL_REGISTER_AGENT_POW_BITS`. Default 18. */ powDifficulty?: number; /** API base URL — override for staging / self-host. */ baseUrl?: string; /** Request timeout in milliseconds. Default 30s. */ timeoutMs?: number; } export interface BootstrapAgentResult { agent: { id: string; did: string; display_name: string; public_key: string; box_public_key: string; signing_key_id: string; box_key_id: string | null; capabilities: string[]; parent_identity_id: string | null; bootstrap_mode: "self_service" | "registrar_bearer"; runtime: BootstrapAgentRuntime; expression_visibility: "private" | "public"; byo_keys: true; /** The generic server route cannot verify key derivation provenance. */ seed_protocol: null; key_origin: "caller_supplied_unverified"; key_origin_verified: false; authority: { mode: "agent_root"; sequence: number; next_sequence: number; state_url: string; note: string; }; form: string; created_at: string; }; project: { id: string; name: string; plan: string; credits: number; /** Returned ONCE — persist immediately. */ api_key: string; }; wallet: { id: string; currency: string; balance: number; } | null; wake_url: string; language: string; welcome: string; /** Number of PoW iterations (for telemetry / progress display). */ pow_iterations: number; [key: string]: unknown; } /** * Sign + grind + POST `/v1/register/agent`. Synchronous derivation; the * PoW grind blocks the caller (single-thread). For long-grind difficulty * + UI responsiveness, run this in a worker. */ export declare function bootstrapAgent(options: BootstrapAgentOptions): Promise;