Expand description
Permissioned widget manifests, signed catalogue data, and safe package installation.
Structs§
- Catalogue
- The signed list of reviewed widgets.
- Catalogue
Entry - A widget listed in the catalogue.
- Installed
Metadata 🔒 - Install record written to
.installed.jsonbeside the manifest. - Installed
Widget - A widget installed on this device.
- Widget
Manifest - A widget’s
widget.json. - Widget
Process - A process a widget declares.
Enums§
- Popout
Shape - Shape of a module widget’s own window.
- Widget
Permission - An action a widget may be granted, named as in manifests.
Constants§
- APP_
VERSION - This build’s version.
- EXAMPLE_
WIDGET 🔒 - The Hello, world! example widget, compiled into development builds only.
- LOCAL_
CATALOGUE - The working tree’s
widgets/andexamples/folders, which development builds list as their catalogue. - MAX_
ARCHIVE_ 🔒BYTES - Largest widget package download, in bytes.
- MAX_
EXPANDED_ 🔒BYTES - Largest total size of a package’s extracted files, in bytes.
- MAX_
FILES 🔒 - Most entries a package may contain.
Functions§
- add_
example_ widget - Adds the example widget to the widgets folder once. A hidden marker file records that it was added, so an uninstalled example stays uninstalled and an edited copy is never replaced. Development builds only.
- app_
supports - Whether this build runs a widget that needs
minimum. Debug builds run unreleased code, so they accept every minimum. - discover_
installed - Reads every installed widget, sorted by ID. Hidden folders, such as staging folders, are skipped, and each unreadable widget yields an error.
- extract_
archive 🔒 - Extracts a ZIP into
staging, rejecting unsafe or duplicate paths, symlinks, too many entries, and oversized content. - folder_
fingerprint - A cheap fingerprint of a folder’s files: their paths, sizes, and modification times, skipping hidden ones. Development builds only.
- install_
archive - Installs a widget package, replacing any installed version only after every check passes.
- local_
catalogue - Builds an unsigned catalogue from the widget folders in
roots, packaging each one in memory so installs run the same checks as catalogue packages. Missing folders list no widgets. Development builds only. - local_
image_ 🔒url - A
data:URL for an image inside a widget folder, orNonewhen the path leaves the folder, isn’t a supported image type, or can’t be read. Development builds only. - meets_
minimum 🔒 - Whether
appis at leastminimum. Pre-release labels are ignored, so0.5.0accepts0.5.0-beta. A missing minimum accepts every version, and an invalid one accepts none. - needs_
newer_ app - The error for a widget that needs a newer Toolblox.
- package_
folder - Packages a widget folder as a ZIP, skipping hidden files and rejecting symbolic links. Development builds only.
- read_
installed 🔒 - Reads an installed widget and checks its install record, including that
widget.jsonhasn’t changed since install. Debug builds accept widgets without a record. - read_
manifest 🔒 - Reads and validates
widget.json, which may be at most 128 KB. - reinstall_
from_ folder - Packages a working-tree widget folder and installs it, with the same checks as a catalogue
package, when the package differs from
installed_sha256. Callsbefore_installfirst. Returns whether it installed. Development builds only. - replace_
atomically 🔒 - Moves
stagingtodestination, keeping the old folder inbackupand restoring it if the move fails. - uninstall_
widget - Removes an installed widget’s folder. A missing widget succeeds.
- validate_
archive_ 🔒path - Rejects archive paths with parent, root, or drive components.
- validate_
https_ 🔒origin - Accepts bare HTTPS origins, such as
https://example.com, without a path, query, or credentials. - validate_
process_ 🔒id - Accepts IDs of 1 to 64 ASCII letters, digits,
_, and-. - validate_
relative_ 🔒file - Requires a non-empty relative path that doesn’t leave the package.
- validate_
sha256 🔒 - Requires 64 hex characters.
- validate_
widget_ 🔒id - Accepts IDs of 1 to 64 lowercase letters, digits, and underscores.
- verify_
signature 🔒 - Verifies a base64 Ed25519 signature with a base64 raw 32-byte public key.
- write_
installed_ 🔒metadata - Writes
.installed.jsonfor a staged widget.