Skip to main content

Module bundle_widgets

Module bundle_widgets 

Source
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§

BundleImportWidgetPreview
What the import preview shows for one widget.
BundleWidget
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.widgets in bundle.json: id → declared hash.
install
Copies w into 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 w as 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
w written 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) under widgets/<id>/ and listed in bundle.json’s components.widgets (SPEC_WIDGET_SHARING_2026_10_10.md §3.4).