Expand description
bundle.import_for_agent: apply an ABF to an existing agent definition,
serialised per agent by bundle_import_for_agent_lock.
StructsΒ§
- Bundle
Import πForAgent Response - Response for
bundle.import_for_agent. - Import
ForAgent πReq
FunctionsΒ§
- bundle_
import_ πfor_ agent_ impl bundle.import_for_agentβ ABF v0.2 Β§2.3. The only import path that processes acomponents.memorykey; the genericbundle.importexplicitly skips it (seeparse_bundle_import_with_budgetβs own components.memory guard). Unlikebundle.import/bundle.import.commit, this is a single-step import β no preview phase β since a memory-bearing import has its own unconditional safety net instead: the target agent must have ZERO existingdb_agent_native_memoryrows, or the whole import is rejected before any write happens. Simpler than skip/rename/replace conflict resolution, and sufficient for v0.2 (see the specβs revision note for why merge semantics are an explicit follow-up, not designed here). Extracted from the RPC closure into a directly-callable, directly-testable function, matchingbundle_import_preview_implβs pattern.- create_
bundle_ πrow - Insert the reusable bundle row for an import; on failure the skills it created are rolled back.
- import_
global_ πskills - Create the bundleβs skills as global skills, exactly as bundle.import does (global, not bound to any agent; skill_upsert_unique_global is the real API β a genuine name conflict is a per-skill warning, any other error aborts the whole RPC). Returns the ids of the skills created.
- memory_
dir_ πfor_ import - The directory the import writes memory into: the one resolved before, unless the manifest has memory files, in which case it must be a verified one.
- refresh_
memory_ πmirror_ before_ check - The agentβs memory directory (None when it has no resolvable working directory), after refreshing the mirror from it when it is a verified one.
- register_
bundle_ πimport_ for_ agent - resolved_
memory_ πpaths - Every
memory/*path listed undercomponents.memoryin a parsed importβs manifest (bundle.json, orarmory.jsonbefore ABF v0.3) β mirrors howcomponents.instructions/components.skillsare read elsewhere in this file, kept local tobundle.import_for_agentsince no other handler needs it. - rollback_
skills π - Delete the global skills an import created, after a later step failed; the errors of any that could not be deleted.
- with_
rollback_ πnote msg, plus a note naming the skills a rollback could not delete.- write_
memory_ πfile - Write one memory file to the live directory and the mirror; false when either write failed (the failure is a warning).
- write_
memory_ πfiles - Bundle files: write through the SAME dual-write path agent:memory:write_file uses (live FS via memory_dir_for_cwd, then the mirror) β writing only to db_agent_native_memory would leave this content visible in Stash while invisible to the actual running agent (see the specβs revision note). Returns how many files were written.