Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:23blocks OS Ai maestro Agent Import

From Leeroopedia
Knowledge Sources
Domains Agent_Transfer, Serialization
Last Updated 2026-10-26 10:00 GMT

Overview

An import pattern that extracts a ZIP archive, restores the registry entry, database, messages, and keys, and optionally clones repositories — with AMP home initialization.

Description

Agent import is the inverse of export: it extracts the ZIP (via `yauzl`), validates the manifest, imports the registry entry (with optional rename via `newName`), restores the CozoDB database, replays inbox/sent messages, restores cryptographic keys, and optionally clones repositories listed in the manifest via `git clone`. It calls `initAgentAMPHome` to set up the AMP directory structure on the target host.

Usage

Use this principle when an agent's state must be restored from a ZIP archive on a target host.

Theoretical Basis

The import is a state restoration with validation:

import(zip, options) =
  extract manifest → validate version
  restore registry entry (rename if options.newName)
  restore database (copy .db file)
  replay messages (inbox + sent)
  restore keys (private.pem, public.pem)
  if options.cloneRepositories: git clone each repo from manifest
  initAgentAMPHome(name, uuid)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment