93 — The marketplace
BuiltRendered from 93-the-marketplace.md in the public repository. Edits belong there.
This page states what a package is, what installing one does, how the catalogue is published to micyte.com, and what an instance's Marketplace lists. What an installed package may do is decided by the port layers in 92.
Packages and extensions
Packages are declared in micyte/tools/_packages.py; they are not generated from the tool registry. micyte_packages() returns them.
| Kind | Ships | Declares | Built with |
|---|---|---|---|
| Package (app) | tools, and the documents they need | — | build_package() |
| Extension | no tools | the port it fills (PortFill) | _extension() |
build_package() takes a package's requires and writes from its tools (requirements_for and declared_writes in micyte/tools/_registry.py); they are not restated in the package.
Installing
fnd_app/instances/_shared/runtime/package_install_runtime.py. An install does two things:
- Writes
tool_exposure, so the instance shows the package's tools. - Provisions what the tools declare they need: the
sourcesrows they read and the blank documents they hold.
It writes no grant. What a tool may write is decided by micyte.ports.datum_write_policy, which denies when there is no grant.
A tool is offered only when the instance holds the documents its requires names, so an install that skipped step 2 would leave a tool that never appears. unmet_requirements() (micyte/ports/tool_package/contracts.py) computes the missing set; the install and the install preview both call it.
Uninstalling sets exposure to false. It deletes no documents.
Publishing the catalogue
The website does not import this repository. The catalogue is exported to files:
micyte/tools/_packages.py the declaration
├─ fnd_app/scripts/export_micyte_package_catalog.py --write
│ └─ micyte-packages.manifest.json in the site's assets
│ ├─ gen_gadgets.py (site repo) → the /gadgets page
│ └─ stamp_release.py (site repo) → the release number and repository URL on pages
└─ fnd_app/scripts/export_micyte_gadget_declarations.py --write
└─ declarations/<id>-<version>.micytepkg.json in a checkout of MiCyte/Gadgets
├─ build_catalogue (Gadgets repo) → catalogue.json, packages.json
└─ sync_gadget_catalogue (site repo) → the copy /gadgets offers for downloadThe portal's GET /__mss/public/packages is computed by the same package_to_dict, so the repository, the site and the portal state the same digest for each package. A package's name, version, summary, tool list and the number of documents it provisions are typed once, in _packages.py. The site shows the number of provisioned documents, not their names.
An instance's Marketplace
Utilities › Marketplace lists five kinds (marketplace_pool.py):
| Kind | What it is | Source | Installing |
|---|---|---|---|
| Web tools | A page on micyte.com that needs no account | fnd_app/instances/_shared/runtime/web_tools.py | Not installed; it is a page |
| Apps | A workspace with its own tabs and documents | The catalogue | Into a chosen sandbox, from Install and update |
| Instruments | A view of one kind of thing across every sandbox | Built in | Nothing to install |
| Extensions | Connects apps to an outside service; no screen | The catalogue | From its card |
| Channels | A read-only surface this instance opens to the outside (91) | Built in | Nothing to install |
Each card states what the item does, what it needs, its version, and its source. The page makes no network request when it is drawn. Three links on a card leave the instance:
- Open on micyte.com (web tools). The one web tool is the Almanac (
/tools/almanac). It opens as its own page on micyte.com, in a new tab, so its address can be bookmarked; it is never framed here. - Preview (apps with a demo).
https://micyte.com/demo?gadget=<id>draws the app's own payload over made-up data with the portal's renderer. The apps with a demo are listed infnd_app/instances/_shared/runtime/tool_demos.py: Quiar, Brevat, Almanac, Oveure and PIM. Enchir has no demo because its subject is a live website. - Declaration (apps and extensions). The package's file in the MiCyte/Gadgets repository, linked only when the repository holds the version shown on the card.
The overlay loads micyte.com in a sandboxed frame with no referrer. The framed page cannot navigate the portal, and nothing done in a demo reaches an instance.
export_tool_demos.py --write writes web_tools.json for the site's Access page from the same web_tools.py; --check refuses a site copy that differs.
The package source port
package_source is a port type with one operation, packages.pull. A pull tells the catalogue's server that this instance exists and which build it runs.
- Unbound (the default): the instance lists its own build's packages (
LocalPackageSource). - Bound: the pull is checked against the binding's actor and the extension's service name. A bound, ungranted source is refused.
- The first fill is the
published_catalogueextension (fnd_app/packages/peripherals/packages/published_catalogue.py,PublishedCatalogueSource). It installs no tools and supplies only the catalogue's address.fnd_app/instances/_shared/runtime/package_update_transport.pyperforms the fetch, authorizes it first, caps the response size and checks every entry's digest before caching it.
tool_package is not bindable; it is the contract every package satisfies.
Not built
- The catalogue address on the binding. The address is still read from the
gadget_catalogueconfiguration key. - A GitHub fill for
package_source. - Installing a package file offline, and the update check an offline instance would run.