Catalogue
The catalogue is a signed JSON file listing every reviewed widget that Toolblox can install. Each entry names a package URL, pins the package’s SHA-256, and lists its permissions. Toolblox verifies the file’s Ed25519 signature over its exact bytes before parsing it, and refuses to install anything that isn’t in it.
Sources:
Catalogue::parse_verified in
src-tauri/src/widgets.rs,
refresh_catalogue_data in
src-tauri/src/app_commands.rs,
and scripts/publish-updates.mjs.
Where it lives
Section titled “Where it lives”| Catalogue | https://toolblox.dev/catalogue/v1.json |
| Signature | https://toolblox.dev/catalogue/v1.json.sig |
| Public key | SRsx1ZzYpQGnV6NhPa00Mt5I6xubH3DXuNdGOfbQSVE= |
Release builds compile the URL and key in from the TOOLBLOX_CATALOGUE_URL and
TOOLBLOX_CATALOGUE_PUBLIC_KEY environment variables at build time. They can’t be changed at run
time.
Format
Section titled “Format”{ "schemaVersion": 1, "generatedAt": 1791504000, "entries": [ { "id": "trade_tracker", "name": "Trade Tracker", "version": "1.2.0", "description": "Logs trades per account and shows value changes over time.", "archiveUrl": "https://toolblox.dev/catalogue/trade_tracker/1.2.0/package.zip", "sha256": "9f2c…64 hex characters…", "permissions": ["accounts.read.basic", "widgetData.read", "widgetData.write"], "iconUrl": "https://toolblox.dev/catalogue/trade_tracker/1.2.0/icon.png", "bannerUrl": "https://toolblox.dev/catalogue/trade_tracker/1.2.0/banner.png" } ]}Top level
Section titled “Top level”| Field | Type | Rule |
|---|---|---|
schemaVersion |
integer | Must be 1. Otherwise: The widget catalogue version isn't supported. |
generatedAt |
integer | Unix time in seconds when the file was generated. |
entries |
array | One object per widget. May be empty. |
| Field | Type | Required | Rule |
|---|---|---|---|
id |
string | Yes | A valid widget ID. Unique in the catalogue. |
name |
string | Yes | Shown on the catalogue card and in the install prompt. |
version |
string | Yes | Valid SemVer. Must equal the package manifest’s version. |
description |
string | Yes | Shown on the catalogue card. |
archiveUrl |
string | Yes | An https URL with a host. Must serve the ZIP without a redirect. |
sha256 |
string | Yes | 64 hexadecimal characters, the package’s SHA-256. Compared case-insensitively. |
permissions |
array | No | The package manifest’s permissions, as a set. Defaults to []. No duplicates. |
iconUrl |
string | No | Image shown on the catalogue card. Any URL the app’s image policy allows, such as https: or data:. |
bannerUrl |
string | No | Image shown across the top of the catalogue card. Same URL rules as iconUrl. |
minAppVersion |
string | No | Valid SemVer, copied from the package manifest. Shown on the catalogue card. Older Toolblox versions can’t install the widget. |
Entry checks, each of which rejects the whole catalogue:
| Problem | Error |
|---|---|
| Invalid ID | Widget IDs may contain only lowercase letters, numbers, and underscores. |
| Invalid version | Widget <id> has an invalid version. |
Invalid minAppVersion |
Widget <id> has an invalid minimum Toolblox version. |
| Invalid hash | A widget checksum isn't a valid SHA-256 value. |
| Duplicate permission | Widget <id> has duplicate catalogue permissions. |
| Unknown permission, missing field, or wrong type | The widget catalogue isn't valid JSON. |
| Unparseable archive URL | Widget <id> has an invalid archive URL. |
| Non-HTTPS or hostless archive URL | Widget <id> must use an HTTPS archive URL. |
| Repeated ID | The catalogue contains widget <id> more than once. |
Unknown fields are ignored.
Signing
Section titled “Signing”The signature is a detached Ed25519 signature over the exact bytes of v1.json.
| File | Contents |
|---|---|
v1.json |
The catalogue JSON, as UTF-8 bytes. |
v1.json.sig |
The 64-byte signature, standard base64, with no trailing newline or whitespace. |
| Public key | The raw 32-byte Ed25519 public key, standard base64. |
Because the signature covers bytes, not the parsed value, anything that changes the file after signing invalidates it: reformatting, reordering keys, changing indentation, adding a trailing newline, or converting line endings. Sign the final bytes and publish them untouched.
scripts/publish-updates.mjs produces both files with Node’s crypto module:
const writeSigned = (path, value, key) => { const bytes = Buffer.from(JSON.stringify(value, null, 2)); writeFileSync(path, bytes); writeFileSync(`${path}.sig`, sign(null, bytes, key).toString("base64"));};The private key is a base64 32-byte Ed25519 seed held in the CATALOGUE_PRIVATE_KEY repository
secret, and the Pages workflow runs the script on each deployment.
Verifying a catalogue locally
Section titled “Verifying a catalogue locally”// verify-catalogue.mjs <catalogue.json> <catalogue.json.sig>import { createPublicKey, verify } from "node:crypto";import { readFileSync } from "node:fs";
const raw = Buffer.from("SRsx1ZzYpQGnV6NhPa00Mt5I6xubH3DXuNdGOfbQSVE=", "base64");const key = createPublicKey({ key: Buffer.concat([Buffer.from("302a300506032b6570032100", "hex"), raw]), format: "der", type: "spki" });const bytes = readFileSync(process.argv[2]);const signature = Buffer.from(readFileSync(process.argv[3], "utf8"), "base64");console.log(verify(null, bytes, key, signature) ? "Signature valid." : "Signature invalid.");How Toolblox loads it
Section titled “How Toolblox loads it”-
When. The first time the interface asks for app state in a session, Toolblox loads the catalogue. After a success, it isn’t fetched again until the next launch. After a failure, the Widgets page shows the error and a Retry button.
-
Configuration. Release builds without a compiled-in URL fail with
This build doesn't have a widget catalogue endpoint. Can you reinstall Toolblox?Development builds without one build it from the working tree instead (see Testing the catalogue locally). A URL without a key fails withThis build doesn't have a widget catalogue key. Can you reinstall Toolblox?, and a URL that doesn’t start withhttps://fails withThe widget catalogue endpoint isn't secure. Can you reinstall Toolblox? -
Download the catalogue. One
GETwith Toolblox’s HTTP client: HTTPS only, redirects not followed, 20-second timeout. A non-2xxstatus fails withThe widget catalogue returned status <code>. Can you try again?The body may be at most 1 MB:The widget catalogue is larger than 1 MB. -
Download the signature. One
GETof the same URL with.sigappended. A non-2xxstatus fails withThe widget catalogue signature isn't available. Can you try again later?The body may be at most 8 KB and must be UTF-8. -
Verify, then parse. The signature is checked against the compiled-in key over the exact downloaded bytes. Only a valid signature lets the bytes be parsed and the entries validated. A bad signature fails with
The widget catalogue signature couldn't be verified. -
Use. The verified catalogue is kept in memory. Every install and update looks its entry up there, so a widget can only be installed from a URL, hash, version, and permission list that came from a verified catalogue.
Every failure is logged as Widget catalogue unavailable: <error>. An invalid catalogue is never
partly used: either every entry passes, or none is loaded. A failed retry doesn’t discard a
catalogue already verified in the same session.
How it appears in the app
Section titled “How it appears in the app”The Catalogue section of the Widgets page shows every entry whose ID has no folder in the widgets
folder, as a card with the banner from bannerUrl, the icon from iconUrl, the name, v<version>, the description clamped to
two lines, and the permission summary. Install opens a confirmation listing the permissions.
When no entry is left to install, the section reads “No other widgets are available.”
For installed widgets, the catalogue is how updates are found: an entry with a higher version than the installed one adds an Update to v<version> button to the installed card. See Packaging.
Getting a widget listed
Section titled “Getting a widget listed”Catalogue widgets live in the widgets/
folder of the Toolblox repository, one folder per widget, named after its ID. The Pages workflow
packages every folder and lists it in the signed catalogue, so a listing is one pull request.
-
Build and test the widget as an unpacked folder in a development build.
-
Add the folder as
widgets/<id>/, withwidget.json, its files, and aLICENSEfile with an OSI-approved license. The manifest needs adescription, which becomes the catalogue description. Aniconin the manifest becomes theiconUrl, and abannerbecomes thebannerUrl. -
Check it with
node scripts/widgets.mjs, which CI also runs. It checks the folder name, manifest fields, declared files, permissions, and license. -
Open a pull request that changes only that folder. Opening it confirms the statements on Review.
-
Review. The widget is checked against the review rules.
-
Listing. After the merge, the Pages workflow packages the folder into
catalogue/<id>/<version>/package.zip, adds its entry with the package’s SHA-256, and re-signs the catalogue. The widget appears in the app’s Catalogue section after the next launch or retry.
Updates follow the same path: change the folder and raise version in widget.json. Each
version gets its own package URL. Packages are built with fixed timestamps and sorted entries, so
an unchanged folder produces the same bytes and the same hash on every run.
Sources: scripts/widgets.mjs
and .github/workflows/pages.yml.
Testing the catalogue locally
Section titled “Testing the catalogue locally”Development builds without a catalogue URL build their catalogue from the working tree’s
widgets/ and examples/ folders instead of downloading it, so a widget can be tested through the
Catalogue section before anything is committed. Toolblox rebuilds it on every state load, so edits
and version bumps show up when the window regains focus.
Each folder is packaged in memory and installed through the same checks as a downloaded package: the SHA-256, the manifest’s ID, version, and permissions, and the path and size limits. A folder with an invalid manifest, or one whose name doesn’t match its ID, shows the error in place of the catalogue. Local entries have no icon, and the catalogue isn’t signed, since it never leaves the device. Release builds always use the signed catalogue.
Source: local_catalogue in
src-tauri/src/widgets.rs.