feat(plugins): an install bridge for the plugin catalog; browsing leaves Settings → Plugins #42

Closed
gabrielvidal wants to merge 0 commits from plugin-catalog into main
pull from: plugin-catalog
Owner

Summary

Lets the seeded plugin-catalog plugin (ai-agent-plugins PR "plugin-catalog") install and uninstall plugins from the public catalog, with the confirmation drawn by the app, and moves catalog browsing out of Settings → Plugins into that plugin's page. Decided in form plugin-catalog-and-public-plugins-repo_al2ibd.

Merge after #39 (this branch sits on plugins-page-rework; until then the diff shows its commits too).

Key changes

  • plugins.manage, a new plugin capability: owner only, in the approval fingerprint.
  • backend/plugins/catalog_repo.py: PLUGIN_CATALOG_REPO, the public mirror's URL (default https://git.gabvdl.xyz/gabrielvidal/ai-agent-plugins-public.git); GET /api/plugins sends it as catalogRepo to the owner only.
  • frontend/src/business/plugins/catalogBridge.tsx: aiAgentPlugin.plugins.list(), .install({source}), .uninstall({id}). The frame only asks:
    • the caller must be the owner (not read-only, not impersonating) and the asking plugin theirs, enabled, approved and holding plugins.manage;
    • a source must be exactly <catalogRepo>#plugins/<id>; the app validates a fresh clone, refuses a folder holding another id, and shows name, version, source and every capability; only the app's own button installs;
    • uninstall asks keep-or-delete each time; a plugin can't uninstall itself.
  • Settings → Plugins (owner): All / Installed / Available becomes a Browse the catalog button; promoted entries wear a For guests pill; ?show=available and ?tab=catalog&kind=… redirect to the catalog page on that category; with the plugin off, a note offers Install the plugin catalog. A guest's page is unchanged.
  • docs/plugins.md, CLAUDE.md, 21 UI strings.

Key decisions

  • The host confirms, the frame asks: a sandboxed page can never approve an install by itself, and can only name plugins of the one configured repo.
  • Owner only: guests keep what the owner promotes (backend filtering untouched).
  • Updates reuse the hub's cached clone (git pull --ff-only): the mirror's history must never be rewritten.

Changelog

  • Added: plugins can be installed, updated and uninstalled from the Plugin catalog page, each time with a confirmation listing what the plugin can do.
  • Changed: Settings → Plugins lists what is installed; browsing what is available moved to the Plugin catalog.

Test notes

  • Backend: 172 modules match the base branch, plus 6 new tests passing (test_typed_plugins fails only because the checkout lives under ~/worktrees; it passes with WORKTREES_DIR set). vitest 1115 of 1116 (FreshContext already failing), tsc clean.
  • Live local hub: the flows of the plugins PR; refusals checked for another plugin's page, a source outside the repo, the catalog uninstalling itself, and a guest.
  • Screenshots taken before the plugins branch was rebased onto its scrub: the Linear description and repo URL in the confirmation are the old ones.
  • Deploy from the Homelab, this PR before the plugins one. Not deployed from the EVOX2.

Screenshots

app-grid-desktop-dark.png
app-grid-phone-light.png
app-detail-desktop-light.png
app-confirm-install-desktop-light.png
app-confirm-uninstall-desktop-dark.png
app-settings-plugins-owner.png
app-settings-plugins-catalog-off.png

## Summary Lets the seeded `plugin-catalog` plugin (ai-agent-plugins PR "plugin-catalog") install and uninstall plugins from the public catalog, with the confirmation drawn by the app, and moves catalog browsing out of Settings → Plugins into that plugin's page. Decided in form `plugin-catalog-and-public-plugins-repo_al2ibd`. **Merge after #39** (this branch sits on `plugins-page-rework`; until then the diff shows its commits too). ## Key changes - `plugins.manage`, a new plugin capability: owner only, in the approval fingerprint. - `backend/plugins/catalog_repo.py`: `PLUGIN_CATALOG_REPO`, the public mirror's URL (default `https://git.gabvdl.xyz/gabrielvidal/ai-agent-plugins-public.git`); `GET /api/plugins` sends it as `catalogRepo` to the owner only. - `frontend/src/business/plugins/catalogBridge.tsx`: `aiAgentPlugin.plugins.list()`, `.install({source})`, `.uninstall({id})`. The frame only asks: - the caller must be the owner (not read-only, not impersonating) and the asking plugin theirs, enabled, approved and holding `plugins.manage`; - a source must be exactly `<catalogRepo>#plugins/<id>`; the app validates a fresh clone, refuses a folder holding another id, and shows name, version, source and every capability; only the app's own button installs; - uninstall asks keep-or-delete each time; a plugin can't uninstall itself. - Settings → Plugins (owner): All / Installed / Available becomes a *Browse the catalog* button; promoted entries wear a *For guests* pill; `?show=available` and `?tab=catalog&kind=…` redirect to the catalog page on that category; with the plugin off, a note offers *Install the plugin catalog*. A guest's page is unchanged. - `docs/plugins.md`, `CLAUDE.md`, 21 UI strings. ## Key decisions - **The host confirms, the frame asks**: a sandboxed page can never approve an install by itself, and can only name plugins of the one configured repo. - **Owner only**: guests keep what the owner promotes (backend filtering untouched). - **Updates reuse the hub's cached clone** (`git pull --ff-only`): the mirror's history must never be rewritten. ## Changelog - Added: plugins can be installed, updated and uninstalled from the Plugin catalog page, each time with a confirmation listing what the plugin can do. - Changed: Settings → Plugins lists what is installed; browsing what is available moved to the Plugin catalog. ## Test notes - Backend: 172 modules match the base branch, plus 6 new tests passing (`test_typed_plugins` fails only because the checkout lives under `~/worktrees`; it passes with `WORKTREES_DIR` set). vitest 1115 of 1116 (`FreshContext` already failing), `tsc` clean. - Live local hub: the flows of the plugins PR; refusals checked for another plugin's page, a source outside the repo, the catalog uninstalling itself, and a guest. - Screenshots taken before the plugins branch was rebased onto its scrub: the Linear description and repo URL in the confirmation are the old ones. - **Deploy from the Homelab, this PR before the plugins one.** Not deployed from the EVOX2. ## Screenshots ![app-grid-desktop-dark.png](https://git.gabvdl.xyz/attachments/cc869502-4562-4b03-9e01-b4768605f172) ![app-grid-phone-light.png](https://git.gabvdl.xyz/attachments/e2ce262a-f971-4734-b23d-0f63d8fc2096) ![app-detail-desktop-light.png](https://git.gabvdl.xyz/attachments/fa5ab2a5-9269-4a99-897f-6bd19ac5606c) ![app-confirm-install-desktop-light.png](https://git.gabvdl.xyz/attachments/d3637901-53b4-434d-a786-6871fd009de7) ![app-confirm-uninstall-desktop-dark.png](https://git.gabvdl.xyz/attachments/9e0d66aa-9ed0-4ef9-a303-307e295a1b62) ![app-settings-plugins-owner.png](https://git.gabvdl.xyz/attachments/99d54ef7-4f2d-469c-8118-b3845c328a01) ![app-settings-plugins-catalog-off.png](https://git.gabvdl.xyz/attachments/240761e9-a662-4671-bdaf-ba19e6a42590)
gabrielvidal self-assigned this 2026-11-28 20:10:03 +01:00
gabrielvidal added 4 commits 2026-11-28 20:10:03 +01:00
The core speaks English only; every other language is a kind: "translation" plugin
(translation-<lang>; the French one is translation-fr in ai-agent-plugins, seeded once at start).

- plugins: kind translation (typed_manifest.parse_translation: lang, name, englishName, flag,
  locale, promptLine, ui/backend JSON dictionaries — strict, operator-only, in the fingerprint);
  a top-level "languages" field on any plugin (default ["en"]) shown on its page; seeding takes
  translation-*; plugins/translations.py reads the enabled ones (first by id wins a code).
- core/i18n: tr / langs / localized / clean_pref / effective_lang read the installed
  translations; a pick whose translation is gone reads English and is kept; browserLang records
  any base code. core/i18n_fr.py and FRENCH_LINE are gone (language_line = the plugin's promptLine).
- The owner picks a language too (users.json ownerLang, PUT /api/me {lang}; English by default).
- Public GET /api/i18n/languages and /api/i18n/{lang} (ETag/304), guest host and sign-in included.
- Coverage: backend/core/i18n_keys/{ui,backend}.json (kept by the two i18n tests,
  UPDATE_I18N_KEYS=1); a translation's page shows translated / missing / stale / placeholder
  mismatches.
- Frontend: frontend/src/i18n/fr removed; the dictionary comes from the hub, cached in
  localStorage and revalidated in the background (first boot in a language waits <= 4 s, any
  failure is English); Lang is a string; number/currency style from the translation's locale;
  LanguageSelect lists English + installed translations (hidden when none); Settings → Plugins
  has a Translations kind (tab, catalog filter, group) and a Translation section with the
  missing-strings count; mock is English only.
- Tests: test_i18n.py rewritten on a made-up translation; i18n_testkit.speaking() for the
  tests that need a second language. authz golden, openapi.json + src/generated regenerated;
  docs/plugins.md (Translations), CLAUDE.md, i18n README, docs/settings.md.

Changelog
- Added: languages are plugins — Settings → Plugins → Translations; the owner can pick a language.
- Changed: French moved to the translation-fr plugin (seeded at start: nothing changes for guests).
- Removed: the core's built-in French dictionaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Orca's layout in the app's own look (form plugins-page-rework_rhce3j): a
category sidebar with counts (a chip row on a phone), search, All / Installed /
Available, a sort (Installed first, Name, Recently updated — per person), and
cover cards or compact rows (the grid / list toggle is kept).

- New manifest field `category` (backend/plugins/categories.py), strict: an
  app picks dev, data, agents, chat, scheduling, media or other (the
  default); a provider / harness / translation sits under its kind's shelf.
  Not in the approval fingerprint. Every row of GET /api/plugins carries the
  resolved category; a record from before the field reads its source's
  plugin.json.
- Translations works as soon as the translation kind exists; an empty
  category is hidden.
- ?cat= / ?show= addresses; the old ?tab= / ?kind= links still land.
- Docs: docs/plugins.md → "Categories and the Plugins page", CLAUDE.md.

Deploy this before installing ai-agent-plugins' plugin-categories branch:
an older core refuses the unknown `category` key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A sandboxed frame may now ask the host to install or uninstall a plugin of
the public catalog — never do it itself (form
plugin-catalog-and-public-plugins-repo_al2ibd):

- New operator-only capability `plugins.manage` (in the approval
  fingerprint). aiAgentPlugin.plugins.list() / .install({source}) /
  .uninstall({id}) answer only the operator, and only a plugin of theirs that
  holds it (enabled, approved); anyone else gets a refusal.
- An install source must be `<catalogRepo>#plugins/<id>`; the host validates
  it (refreshed clone), checks the folder holds that id and draws the
  confirmation — name, version, source, every capability, what an update
  replaces — before its own POST /api/plugins/install. An uninstall asks keep
  or delete data and secrets each time. A plugin can't uninstall itself.
- PLUGIN_CATALOG_REPO (plugins/catalog_repo.py, default the public mirror
  gabrielvidal/ai-agent-plugins-public.git), served as `catalogRepo` on
  GET /api/plugins to the operator only.
- Settings → Plugins (operator): All / Installed / Available gives way to
  *Browse the catalog* (the page that opens `plugin-catalog`); promoted hub
  catalog entries wear *For guests*; old ?show=available / ?tab=catalog&kind=
  links redirect to the plugin's page on that shelf; with the plugin off, a
  note offers to install it again. Guests' page unchanged.

Tests: test_plugin_catalog_bridge.py (capability, repo rule, guest kept out),
catalogBridge.test.tsx (refusals, confirm-then-install, cancel, keep/delete).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner
Merged into `main` as 7860d211 by the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/cadefe6f-0940-4688-bc56-1306d9265430.
gabrielvidal closed this pull request 2026-11-28 21:10:26 +01:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gabrielvidal/ai-agent#42