Expand description
bundle.* MuxAPI handlers β the Armory Bundle Format (ABF) surface.
Module layout (split 2026-09-22): this file holds registration, the plain
CRUD/validate/self_get handlers, and the helpers every family shares;
each bundle.* family lives in its own child module. The children are
glob-imported back here so that, exactly as when this was one file, any
function can call any other without an import.
ModulesΒ§
- components π
- Component plumbing shared by the per-agent export and import paths: purging dangling component refs, resolving a bundleβs components to their backing rows, and splicing history/instructions/memory into a manifest.
- export π
bundle.export: serialise one stored bundle to an ABF archive.- export_
for_ πagent bundle.export_for_agent/bundle.export_for_agent_with_history: build an ABF from a live agent definition, optionally with its session history under the size budgets defined here.- import π
bundle.import,bundle.import.preview,bundle.import.commit: the ABF file/bytes intake path, its size and warning budgets, and the two-phase preview/commit flow.- import_
for_ πagent bundle.import_for_agent: apply an ABF to an existing agent definition, serialised per agent bybundle_import_for_agent_lock.
StructsΒ§
- Agent
Project πInstruction File - One file in
agent.project_instructions: a resolvedProjectInstructionFile, plus how it compares to the last launchβs observation of it. - Agent
Project πInstructions Req - Agent
Project πInstructions Response - Response for
agent.project_instructions. - Bundle
GetReq π - Bundle
List πItem - One
bundle.listrow: a bundleβs summary fields, not the whole bundle. - Bundle
List πResponse - Response for
bundle.list: the same rows under both keys (seebundle_list_impl). - Bundle
Self πGetReq - Requirement
Resolution π - Read-only account-requirement resolution (spec Β§4.5) β one identity
lookup per DISTINCT provider, not per requirement row (codex P1, PR
#2379 round 4:
bundle_import.rsbounds the requirements array length, but even at that bound many rows commonly share a handful of providers). Extracted here (Phase 3 spec Β§3.1βs account-resolution implementation note) so the existingbundle.importroute and the newbundle.import.preview/.commithandlers share the exact same resolution logic rather than duplicating it in a second place where it could drift. Full, untruncated values β callers apply the shared bounded-display projection (bounded_display) toid/provider/envbefore ever serializing these into an RPC response (Phase 3 spec Β§3.1, round 11).
EnumsΒ§
- Self
Owner π - The agent a self-scoped MuxAPI call is about β whose personal memory
(
memory.*, M4c-2b), linked accounts (identity.self.accounts,identity.account.validate), bound preset (preset.getself) and history (history.search, M4c-2c) β identity spec Β§6.5.9.
StaticsΒ§
- BUNDLE_
IMPORT_ πFOR_ AGENT_ LOCKS - Per-agent async lock serializing
bundle.import_for_agentβs βcheck zero existing memory rows, then writeβ sequence β ABF v0.2 Β§2.3, reagent P2 on PR #2527. Mirrorsagent_open.rsβsAGENT_OPEN_LOCKSprecedent exactly, including its scope note: this only serializes calls handled by THIS process, not a genuinely different AgentMux instance/channel racing the same agent_id.
FunctionsΒ§
- bounded_
display π - Shared bounded-display projection (Phase 3 spec, round 12βs governing
rule) for every βmeant to be shortβ field both
previewandcommitecho back: skill slug/description, requirementid/provider/env, context-filedisplay_path, bundledescription, and commitβsskipped_skills/resolved_requirement_idsentries.bundle.nameis NOT projected through this β itβs bounded at parse time instead (round 13), since itβs re-submitted verbatim asbundle_name. - bundle_
get_ πimpl - bundle_
import_ πfor_ agent_ lock - bundle_
list_ πimpl - bundle_
self_ πget_ by_ memory_ id - The bundle
memory_idnames, or the blank singleton when none is bound. - bundle_
self_ πget_ impl - bundle_
validate_ πimpl - Structurally validate a bundle draft β ABF
UI-alignment pass. Takes the SAME payload shape
bundle.upsertaccepts (reuses itsnormalize_bundle_upsert_input), not just an id, so the Memory β Bundles editorβs βValidateβ button can check an unsaved draft (including a brand-new bundle with no id yet) rather than only whatever was last persisted. - normalize_
bundle_ πupsert_ input - Normalize a
bundle.upsertrequest body into the shape theBundlestruct deserializes from, so MuxAPI accepts the request exactly as documented in the spec: - register
- register_
agent_ πproject_ instructions agent.project_instructionsβ what this agent will actually read.- register_
bundle_ πdelete - register_
bundle_ πget - register_
bundle_ πlist - register_
bundle_ πself_ get - register_
bundle_ πupsert - register_
bundle_ πvalidate - resolve_
account_ πrequirements - resolve_
agent_ πfor_ s1 - Resolve the agent definition behind an S1-authenticated
agent_id.