magpie icon indicating copy to clipboard operation
magpie copied to clipboard

[feat] provider bundles: one manifest that installs the packages it names — no credentials inside

Open MYCF711 opened this issue 1 month ago • 2 comments

The gap

A new magpie user who wants "the setups people are actually running" has to install provider plugins one at a time. The registry (magpie-community/plugins) lists ~60 packages; picking a working combination means reading each one, installing it, signing in, and repeating.

There is a sync/backup mechanism that already carries providers and plugins (internal/backup/backup.go:70, :87-91), but it is personal: it ships credentials (ProvidersKeys, LibraryKeys — :94), so it cannot be published and cannot be shared.

What is missing is a provider bundle: a manifest that says "this setup consists of these packages", installable by anyone, containing no accounts and no credentials.

Why an aggregator plugin is not the answer

The current workaround is a single plugin that carries several vendors behind one package (the "hub" pattern). That works, but:

  • one maintainer carries every vendor's auth, quota, and breakage in one repo;
  • a vendor's fix cannot ship without cutting a version of the whole hub;
  • the vendor's own plugin and the hub's copy drift apart (#515 is the same observation from the scaffold side: shared plumbing should be the plugin's job, not a god-plugin's);
  • every user installing the hub gets all vendors whether they want them or not.

A bundle keeps one package per vendor (which is how the registry wants it) and only adds a list.

Proposal

A bundle is a JSON manifest that names packages, nothing more.

{
  "name": "Everyday DeepSeek + Claude",
  "description": "What I run; keys are yours, none are included.",
  "packages": [
    { "spec": "@magpie-community/opencode-kimi-work-auth", "version": ">=0.3" },
    { "spec": "magpie-trustoken-auth" },
    { "spec": "github:someone/magpie-officeace" }
  ]
}

spec is exactly what magpie plugin add already accepts today (npm name, github:owner/repo, tarball URL). That is deliberate: no new resolution code, the bundle only replaces "type each name" with "read one list".

Install entry points

  • CLI: magpie plugin add ./bundle.json — if the file parses as a bundle, install every entry; otherwise keep today's behaviour.
  • GUI: the same file/URL field the plugin installer already has.
  • Optional later: a bundles section in the registry, so a bundle is discoverable the same way a package is.

Safety, because a bundle is a list someone else wrote

  • A bundle must not be able to carry auth, providers[].accounts, tokens or keys. Reject the manifest if it does — that is the line between a bundle and a backup, and it keeps "install this bundle" from becoming "install these credentials".
  • Show the resolved list and ask once before installing (a pinned version is fine to skip asking).
  • Install each entry through the existing path, so signature/version checks stay where they are.

What it does not need to do

  • No new registry endpoint, no version solver, no lockfile in the first cut. version is a lower bound check against what npm reports; anything fancier can come later if people actually ask.

Implementation sketch

  • internal/plugin/bundle.go: parse + validate (reject credentials, cap entry count, resolve spec through the existing add path).
  • CLI: magpie plugin add sniffs the JSON before treating the argument as a spec.
  • GUI: POST /api/plugins/bundle — plan first (resolved + skipped), then apply.
  • Tests: a bundle with a credential field is rejected; a bundle installs N packages and reports which failed; a non-bundle JSON keeps the old error.

What I would use it for

Not hypothetical: I maintain six provider packages (magicrew, officeace, loomy, trustoken, accio, codearts+officeace merged) and the recurring support question is "which ones do I install, and in what order". A bundle answers that with a file. It is also the thing that makes the registry's per-package model usable by someone who has never installed a plugin.

MYCF711 avatar Oct 30 '26 12:10 MYCF711

Thanks for the detailed write-up. We're not going to add bundles, at least for now. Here's why.

  • One file would install other people's choices in one step. A bundle can name any github: repo or tarball. So "install this bundle" becomes "install every package someone else listed", with a single confirmation for all of them. Today each package is installed on its own, and its Plugins-page entry shows who maintains it and what it reaches. We'd rather keep that one decision per package.
  • It saves little time. Installing a provider plugin takes one click on the Plugins page. The slow part of setting up a vendor is signing in, and a bundle can't do that, since it rightly carries no accounts.
  • The registry's listing rules would no longer cover what's installed. Bundles shared outside the registry would bypass the review a registry entry gets.

If finding a working setup is the real pain, we'd rather improve the Plugins page itself, for example with better search or showing which packages are popular. Ideas there are welcome.

Closing as not planned. We can reopen it if more users ask for this.

yetone avatar Oct 30 '26 13:10 yetone

Closing is fine — I won't reopen it.

One correction that matters only if this comes back: the "single confirmation for all of them" point is a detail of my draft, not of the idea. One confirmation per package, with the resolved list shown first, is what I would want too; I wrote "ask once" meaning one dialog, and that was the weaker version. Take it as conceded.

That leaves your third point — bundles shared outside the registry bypass review — and it has a narrow answer: entries only from registry.json, no github: or tarball specs. The review has then already happened per package, and it is a strict subset of what the Plugins page installs today, not a new install path. Your first point's "any github: repo or tarball" is exactly what that restriction removes.

Not asking for it now, and "if more users ask" is a reasonable bar. I'm writing the shape down here so the next person who asks doesn't have to re-derive it.

MYCF711 avatar Oct 30 '26 13:10 MYCF711