Versioning
A plugin's version is a plain string comparison between the catalog document and what a project has installed, there is no semver range matching.
A plugin's version lives in two places: doc.version on the catalog document (the latest uploaded
version), and app_plugins_purchased[plugin_name].version on each project that installed it (the
version that project actually has). Nothing keeps these in sync automatically.
Where the version comes from
upload_plugin sets doc.version differently depending on where the package lives:
npmpackage source: read straight off the registry withgetPackageManifest(plugin_name), so it is whatevernpm versionproduced when the author last rannpm publish. Every first-party plugin'spackage.jsonhas apubscript for this:npm version patch --force && npm publish --access public.xuda_hostedpackage source (no npm publish involved, the working copy is packed and hosted by the platform itself):doc.versionis whatever was sent in the request, or0.1.0if nothing was.
install_plugin copies doc.version onto the project's app_plugins_purchased entry at the
moment of install. A later upload_plugin that bumps the catalog document's version does not
touch projects that already installed an earlier one, they keep the version they installed until
something installs the new one over it.
How a stale install is surfaced
There is no automatic update. What exists is a visual comparison: the plugin card's version badge
compares app_plugins_purchased[plugin_name].version (what is installed) against the catalog
document's version (the latest), rendering the installed number in green when they match and
amber when they do not. Nothing forces the reinstall, an owner (or an installer)
re-running install_plugin on the same project is what pulls the newer version in, the same call
used for a first install.
Updating a plugin you own
The dashboard's Update with AI button, shown on a plugin's card to its owner, does not bump the
version itself. It opens the Ask AI assistant pre-seeded with metadata: { plugin_action: 'modify', plugin_name, widget_type: plugin.plugin_type } and a prompt naming the plugin
(updateWithAi() in Tab_plugins.vue), which drives the AI plugin builder
(ai_module.create_plugin_via_ai, the same generator utils/create_plugin_via_ai.mjs calls
directly) to edit the plugin's code and re-upload it, that upload is what advances doc.version.
upload_plugin treats any update where visibility is already 'private', or
skip_publish_review is set, as a private code change: it carries the plugin's existing
visibility and publish_stat forward untouched rather than resubmitting it for marketplace
review. Going from private to public is only ever publish_plugin, a separate, explicit action;
see publishing.