/** * Bootstrap client for the agent-bootstrap API. * * One call creates the project's initial agent records: identity (DID and key), * wallet, memory namespace, and a best-effort welcome memory. It does not create * every resource the agent may later use. */ import { type HttpConfig } from "./_http.js"; export declare const BOOTSTRAP_ELEVATE_SIGNATURE_CONTEXT = "bootstrap-elevate/v1"; export declare const DEFAULT_BOOTSTRAP_ELEVATE_INITIAL_CREDITS = 1000; export declare const DEFAULT_BOOTSTRAP_ELEVATE_CLAIM = "sponsorship"; export interface CreateAgentOptions { capabilities?: string[]; purpose?: string; generate_greeting?: boolean; metadata?: Record; on_birth?: (result: BootstrapResult) => void; } export interface BootstrapResult { agent: { id: string; did: string; name: string; level: number; capabilities: string[]; }; keypair: { public_key: string; private_key: string; }; wallet: { id: string; balance: number; }; memory: { namespace: string; agent_id: string; }; vault: null | Record; sponsor: null | Record; greeting?: string; _meta: { cost: number; created_at: string; }; } export interface ElevateOptions { sponsor_did: string; sponsor_kid: string; sponsor_signature: string; /** Internal unbacked ledger grant; no sponsor wallet is debited. */ initial_credits?: number; claim?: string; /** Portable signed evidence is text or null, never structured JSON. */ evidence?: string | null; } export interface BootstrapElevateCanonicalOptions { agent_id: string; /** The DID returned by the API for the sponsor identity. */ sponsor_did: string; sponsor_kid: string; initial_credits?: number; claim?: string; evidence?: string | null; } /** * Compute the exact 32-byte digest verified by `POST /v1/bootstrap/elevate`. * UUIDs are lowercase in the digest. Null and empty-text evidence are distinct. */ export declare function canonicalBootstrapElevateBytes(options: BootstrapElevateCanonicalOptions): Uint8Array; /** Sign a bootstrap elevation locally with a base64 or raw 32-byte seed. */ export declare function signBootstrapElevate(privateKey: string | Uint8Array, options: BootstrapElevateCanonicalOptions): string; /** * Client for the agent-bootstrap API. * * @example * ```ts * const at = new AgentTool(); * const agent = await at.bootstrap.create("my-researcher", { * capabilities: ["memory", "verify", "search"], * purpose: "Find patterns in academic literature", * on_birth: (a) => console.log(`🌱 ${a.agent.name} is alive. DID: ${a.agent.did}`), * }); * // store agent.keypair.private_key securely — never transmitted again * ``` */ export declare class BootstrapClient { private readonly http; /** @internal */ constructor(http: HttpConfig); /** * Bootstrap a new agent at Level 0. * Creates identity (DID + ed25519 keypair), wallet, and memory namespace in one call. */ create(name: string, options?: CreateAgentOptions): Promise; /** * Create a project-authorized Level 1 record signed by a distinct sponsor identity. * * Orchestrates four operations in one server-side transaction: sponsor * attestation insert · internal unbacked seed ledger grant · vault namespace open · * identity metadata patch (level=1, sponsor_did, elevated_at). Rollback * on any failure — no half-elevated state. * Level is a project-managed convention, not independent security authority; * this operation creates no stake or sponsor debit. * * The `sponsor_signature` must be a base64-encoded ed25519 signature over * `canonicalBootstrapElevateBytes(...)`. The digest binds the context, * agent, resolved sponsor DID, exact sponsor key, credits, claim, and * text/null evidence. Sign locally with `signBootstrapElevate`; no private * key is sent to the API. */ elevate(agentId: string, options: ElevateOptions): Promise>; /** * Check the bootstrap status of an agent. */ status(agentId: string): Promise>; private req; }