Expand description
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.
Structs§
- Bundle
Import 🔒Req - Bundle
Import 🔒Response - Response for
bundle.import. - Resolved
Import 🔒Input - The outcome of resolving one of
file_path/zip_base64/filesinto intake-ready files plus the Phase 3 content digest (§3.0.5) — shared bybundle.import.previewand.commitso both compute the digest identically. The mode tag baked intocontent_digest(round 7) means a plain digest-equality check at commit is sufficient to enforce “same input mode as preview” (round 6) — no separate mode field is needed.
Constants§
- MAX_
ABF_ 🔒FILE_ SIZE_ BYTES - On-disk size ceiling for
file_pathinput (Phase 3 spec §3.0.5, rounds 4/5) — generous headroom aboveMAX_TOTAL_UNCOMPRESSED_BYTES’s 50 MiB for compression/container overhead and imperfectly-compressed content. - MAX_
PROJECT_ 🔒INSTRUCTION_ PREVIEW_ CHARS - Final combined-list bound applied to a preview/commit response’s
warnings(Phase 3 spec §3.1 round 8 / round 9’s commit-response generalization) — cheap defense-in-depth over an already per-source-bounded list (each ofresolve_import_input’s intake warnings andparse_bundle_import_with_budget’s own warnings is already individually bounded; concatenating two independently-bounded lists can still exceed either bound alone, so one more pass caps the combined total before it’s ever serialized). Per-entry content cap forproject_instructionsin an import preview.
Functions§
- bound_
warnings_ 🔒for_ response - bundle_
import_ 🔒commit_ impl bundle.import.commit— Phase 3 §3.2. Re-resolves and re-parses the same input fresh (never trusts client-supplied preview data for anything written), rejects on a content-digest mismatch, then writes only the selected items. Sharesbundle.import’s existing skill-write/ rollback logic; the differences are selection filtering, thebundle_name/import_asoverrides, and the digest gate. Extracted from the RPC closure into a directly-callable, directly-testable function (the closure itself only deserializes the request and forwards).- bundle_
import_ 🔒preview_ impl bundle.import.preview— Phase 3 of docs/specs/SPEC_ABF_IMPORT_UI_PHASE3_2026_08_02.md §3.1. Pure parse plus read-only collision/name-collision lookups — zero Store writes. Window- scoped like the rest ofbundle.*. Extracted from the RPC closure into a directly-callable, directly-testable function (the closure itself only deserializes the request and forwards).- install_
bundle_ 🔒widgets - After a commit: copy in the chosen widgets and ask the user to approve
each, the way an agent’s
WidgetInstalldoes. The archive is read again and held to the digest the user previewed, so what installs is what they saw (SPEC_WIDGET_SHARING_2026_10_10.md §3.3). A bundle never approves a widget. - preview_
commit_ 🔒warning_ budget - Bounded warning budget shared by
bundle.import.preview/.commit(Phase 3 spec §3.1, round 11) — unlike the existingbundle.importroute’s effectively-unbounded budget, preserved unchanged above. - preview_
widgets 🔒 - The import preview’s line for each widget the bundle carries.
- read_
abf_ 🔒file_ path - Reads a
file_pathinput server-side (Phase 3 spec §3.0.5). Opens the path with a no-follow mechanism so a symlink fails to open at all rather than being silently resolved to its target (round 6) — one handle, one continuous read, no second path resolution for anything to race against (round 5’s TOCTOU fix): metadata comes from that SAME open handle and is checked againstMAX_ABF_FILE_SIZE_BYTESBEFORE any read (round 4); the actual read is still hard-bounded via.take(...)regardless of what the metadata claimed. - register_
bundle_ 🔒import bundle.import— ABF importer, Phase 2 of docs/specs/SPEC_ABF_V0_1_SINGLE_FILE_AND_IMPORTER_2026_08_01.md. Window- scoped likebundle.export(bundles aren’t agent-specific). Accepts EITHERzip_base64(a.abfarchive, mirroringbundle.export’s ownzip_base64response field) ORfiles(a raw[{path, content}]list) — exactly one must be present. Hands the bytes to the purebundle_importmodule for parsing/validation, then owns every Store side-effect: creates the bundle row, creates one global Skill row per parsed skill, and performs READ-ONLY account-requirement lookups (never creates an account, never writes a secret anywhere — see the spec’s §4.5 correction for why this stopped short of “resolving” placeholders in place).- register_
bundle_ 🔒import_ commit - register_
bundle_ 🔒import_ preview - resolve_
import_ 🔒input - split_
widgets 🔒 - Takes a zip’s widget entries out of the text files and their warnings, and reads them as bytes instead.