Expand description
Template Hub - a browsable catalog of downloadable flow templates.
The Model Hub (crate::hub) browses + downloads AI-model artifacts; the
Template Hub is its analog for flow templates. The catalog is a
checked-in JSON file ([template_catalog.json]) shaped as an API-response
envelope { "apiVersion": "1", "templates": [ … ] } - a proof-of-concept of
the future cloud template registry, exactly mirroring the Model Hub’s
hub_catalog.json. Each entry embeds the full FlowGraph; “downloading” an
entry copies that graph into the local template store
(~/.flow-studio/templates/), after which it shows up in the top-bar
Load modal like any other saved template.
Editing the JSON is all it takes to add/remove templates - no Rust changes, and no product-specific templates hardcoded in the codebase.
Structs§
- HubInstalled
Status - Where a hub template currently lives in the local store, plus what
version was last installed.
Nonewhen nothing matches. - Template
HubEntry - Browse metadata for a hub template (no embedded graph - that’s resolved on install). Serialized to the frontend with camelCase keys.
- Template
HubEntry With Status - One hub entry + install status. The
update_availableflag is pre-computed server-side so the frontend doesn’t need to parse versions.
Functions§
- add_
to_ collection - Install a catalog entry into a user-chosen collection.
- catalog
- Browse list: catalog entries mapped to display metadata (+ node/edge counts from the embedded graph).
- catalog_
with_ status - Annotate the catalog with per-entry install status. A template counts as installed when either:
- update_
installed - Overwrite an installed hub template in place with the catalog’s current
graph, bumping
hub_version. Whenforceis false and the user has edited the file (mtime > installed_at), returns aRefusederror so the frontend can prompt the user before clobbering local edits.