Collection index¶
A collection is a directory with index.json and package files. Online collections are GitHub releases
with the same layout.
Directory¶
A flat collection puts the .mpk files next to index.json and uses --flat with mibpkg index.
index.json¶
{
"format": 1,
"collection": {
"id": "my-packages",
"name": "My packages"
},
"packages": [
{
"name": "hello",
"version": "1.0.0",
"file": "packages/hello-1.0.0.mpk",
"sha256": "…",
"size": 12345,
"description": "Hello package",
"compat": { "units": ["MHI2Q"] },
"uses_scripts": false
}
],
"signatures": []
}
| Field | Meaning |
|---|---|
format |
1 |
collection.id |
[a-z0-9-]{1,40}; uploaded is reserved |
collection.name |
Shown in the web interface |
packages[].name |
Package name |
packages[].version |
Semver |
packages[].file |
Relative path or absolute https:// URL |
packages[].sha256 |
Lowercase hex SHA-256 |
packages[].size |
Bytes |
packages[].compat |
Same shape as [compat] |
packages[].uses_scripts |
Whether the package runs scripts |
packages[].kind |
plugin or sdk, absent for a plain package |
packages[].permissions |
A plugin's declared permissions |
packages[].min_sdk |
A plugin's oldest supported mibsdk version, when declared |
packages[].page_preview |
The first ~1 KiB of the package's store page (cut at a paragraph), when it has one |
packages[].page_bytes |
Size of the full store page in bytes |
packages[].page_sha256 |
SHA-256 of the full store page; the unit checks the page it fetches against it |
signatures |
Reserved; ignored in v1 |
The three page_* fields are optional and format stays 1: an index without them is valid, and an
older mibpkg ignores them. The web interface shows page_preview at once and fetches the full page from
the package (its first archive entry) when the user taps Load more.
Build it¶
The collection id and name are validated. Each file name must be <name>-<version>.mpk and match the
manifest inside.
Online URLs¶
An online index may use absolute https:// URLs in file. A relative path resolves against the release's
download directory. mibpkg release writes absolute URLs for every release asset.
Source list¶
A card can carry mibpkg/sources.toml:
mibpkg release can attach a sources.json asset with the same entries; new cars read it from the
official collection.
Verify¶
verify checks the index format, file names, checksums, versions, compatibility and plugin metadata.