Expand description
Widgets in agent bundles (docs/specs/SPEC_WIDGET_SHARING_2026_10_10.md §3).
An ABF v0.4 bundle may carry whole widget packages under widgets/<id>/,
binary files included, and list them in bundle.json as
components.widgets: [{ id, version, hash }]. Importing the bundle offers
them; it never approves one: each is copied into the widgets folder and
asks for the user’s approval like a widget installed from a folder.
Bundles carry sandboxed widgets only.
Structs§
- Bundle
Import Widget Preview - What the import preview shows for one widget.
- Bundle
Widget - One widget package read out of a bundle.
Constants§
- MAX_
BUNDLE_ WIDGETS - At most this many widgets in one bundle.
- MAX_
BUNDLE_ WIDGET_ BYTES - All of a bundle’s widgets together, decompressed: each is also held to the widget limit (50 MB), but this bounds the whole archive, whatever its compression ratio.
- WIDGETS_
DIR - Where a bundle keeps its widgets, relative to the bundle’s root.
Functions§
- declared
components.widgetsinbundle.json: id → declared hash.- install
- Copies
winto the widgets folder, replacing an installed version. - is_
widget_ path - Is
path(bundle-relative, as the text importer sees it) part of a widget? - is_
widget_ warning - Is the text importer’s warning about a widget entry? Its warnings start with the entry’s path, wrapper-stripped or (for an unsafe path) raw.
- preview
- Checks
was the widget code would, against what the bundle declares and what is installed here. - read_
from_ zip - The widgets in a bundle zip: every entry under
[<wrapper>/]widgets/<id>/. The text importer has already bounded the archive (entry count, sizes); this holds each widget to the widget limits too. - stage
wwritten out as a package folder<tmp>/<id>/, for checking and installing with the widget code’s own rules.- zip_
export_ with_ widgets - A bundle export as a zip, with
widgets(each an approved package’s id, content hash and files) underwidgets/<id>/and listed inbundle.json’scomponents.widgets(SPEC_WIDGET_SHARING_2026_10_10.md §3.4).