Ampify
English

Publishing

The Marketplace lists what is in the public catalog, Shirowwww/ampify-catalog: its catalog.json, the archives, and the readable sources of every element.

Propose an element in five steps

Anyone can propose a theme, a snippet, an extension or an app. You need Ampify and a GitHub account; you do not need to know git.

  1. Start from a template: ampify new theme my-theme (or snippet, extension, app). The folder name is the element’s id.
  2. Add a picture of the element at work: preview.jpg or preview.png, 1280 by 720, taken in Apple Music, and "preview": "preview.jpg" in the manifest. Blur the lyrics or cover them with grey bars, and hide anything personal, such as your name. The check refuses an element without a preview.
  3. Run ampify validate my-theme, and ampify test my-extension for an extension or an app.
  4. Install the GitHub CLI and sign in once with gh auth login, then run ampify publish my-theme. It opens the pull request for you.
  5. Read the comment the check leaves on the pull request. If it lists a problem, fix it and run ampify publish again. A maintainer then reads the code and merges it.

After the merge, the element shows in the Marketplace as soon as the bot has packed it. The bot writes it to catalog-1.5.json, the catalog that Ampify 1.5.0 and later read, and to the older files only when their releases can install it: catalog-1.3.json, read by Ampify 1.3.0 to 1.4.1, and catalog.json, read by Ampify 1.2.1 and older. Your pull request touches none of them. To send a new version later, raise version in the manifest and publish again: everyone who installed it gets it on their own within a day (see Updates).

Publish an element

ampify validate my-theme       # the manifest and files
ampify test my-extension       # main.js against a fake host (extensions and apps)
ampify publish my-theme        # checks again, then opens the pull request

ampify publish needs the GitHub CLI (gh), installed and signed in. It forks ampify-catalog (or reuses your fork), puts the folder in sources/<id>/ on a branch add-<id>-<version>, and opens the pull request with the name, kind, version, permissions and description filled in. You need no clone and no git. Without gh, it prints the steps to do in the browser. --dry-run shows the plan without any network call.

For an update, raise version in the manifest and publish again.

Review

A README.md at the root of the element’s folder is shown on its page in the Marketplace, below what it can do: what it is for, how to use it, its settings. It is published next to the archive as packages/<id>-<version>.md, with no field in catalog.json. The page shows headings, paragraphs, lists, bold text, code and links; images are left out, the preview is the picture.

ampify build <folder> writes a zip and its catalog entry for a catalog of your own (--catalog). The public catalog’s archives are always packed by the bot.

Catalog format

{
  "catalogVersion": 1,
  "extensions": [
    {
      "id": "hello-extension",
      "name": "Hello",
      "version": "0.1.0",
      "kind": "extension",
      "author": "Shirowwww",
      "description": "Minimal example: writes to the log and keeps a launch counter.",
      "kitApi": "1.0",
      "url": "https://example.com/releases/hello-extension-0.1.0.zip",
      "sha256": "0000000000000000000000000000000000000000000000000000000000000000",
      "permissions": ["storage"]
    }
  ]
}
Field Required Rule
id, name, version, kind, author, description, kitApi yes As in the manifest. id is unique in the catalog
url yes A .zip on https://, with the element’s folder content and manifest.json at its root
sha256 yes SHA-256 of the archive, 64 lowercase characters
homepage, license, tags, permissions no Copies of the manifest fields
preview no An https:// .png/.jpg/.jpeg address on the catalog’s host or the archive’s host
translations no A copy of the manifest’s. Not written by tools/pack.py nor ampify build (see Compatibility)
minAmpify no The oldest Ampify release that takes this version, like 1.3.0. Read from Ampify 1.3.0 on
newer no Later versions of the same element (see below)

Several versions of one element

An entry can list later versions of its element in newer. Each item is a full entry with the same id, kind and author, a higher version, and a minAmpify. Ampify 1.3.0 and later take the newest version whose minAmpify they reach, and leave out an element when they reach none. Ampify 1.2.1 and older do not know newer and read only the entry itself, so the entry keeps the version they understand.

{
  "id": "glass", "version": "1.2.1", "url": "https://.../glass-1.2.1.zip", "...": "...",
  "newer": [
    {"id": "glass", "version": "1.3.0", "minAmpify": "1.3.0", "url": "https://.../glass-1.3.0.zip", "...": "..."}
  ]
}

The bot writes this from the element’s manifest: a version whose manifest names a minAmpify goes to newer with it (or becomes the entry when it is the first one), a version without replaces the entry. Old archives stay where they are. An archive already published under a version must hold the same files; packed by other tools, its bytes may differ.

kit.manage is refused in a catalog entry, by the clients and by the public check alike: only Ampify’s own Marketplace holds it. Next to the entries, versions.json lists the Apple Music versions tested after a release; catalog.json pins its address and SHA-256, and ampify versions update reads it. Schema: schemas/catalog.schema.json, which refuses a field it does not list.

Compatibility

What install checks

ampify install, and the Marketplace page that calls it, check in this order:

  1. The id is valid and in the catalog, and the address is https://.
  2. The name, author, description and permissions are shown. Without --yes, the answer must be “y”.
  3. The downloaded archive must have the catalog’s SHA-256, or it is thrown away.
  4. Each file name is checked (no absolute path, no .., no \, no control character), then the archive is extracted to a work folder. A symbolic link refuses everything.
  5. The manifest must match the catalog’s id, kind and version, and ask for the same permissions as the entry that was shown (in any order). A permission reserved for Ampify’s Marketplace (kit.manage) is refused in either.
  6. Only then is the folder put in place; an older version stays until this succeeds.

Nothing downloaded runs during an install, and ampify install leaves the new element off. The Marketplace puts it on right after: a theme in use, anything else turned on. For an element that asks for permissions, the card’s Install… opens its detail view first, which lists what it may do. An update keeps the element’s settings.

An element tagged developer (with example, for the examples of examples/) is listed in the Marketplace’s Developers tab instead of the tab of its kind.

Updates

Installed elements follow the catalog on their own. Once a day, while Apple Music is closed, the background launcher runs ampify update --auto, which brings each installed element to the newest version the catalog offers for this release of Ampify, with the same checks as an install. Its settings stay, and so does whether it is on. This does not depend on kit_update, which only concerns Ampify itself.

A new version that asks for a permission the installed one did not have is not installed this way: the Marketplace shows Update on its card, and the detail view lists what it may do before you accept. ampify update <id> updates one element by hand. What happened is in logs\update.log.