Principle:23blocks OS Ai maestro Agent Import
| 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)