feat(plugins): retire core Services catalogue into services live plugin #31

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

Summary

Completes the migration of the homelab Services catalogue out of ai-agent core into the services live plugin (ai-agent-plugins PR companion). Core retires backend/services/, /api/services, /api/service, Service.tsx, the Projects & Services split UI, /services* routes, ai-agent services, and MCP browse services, replacing them with generic plugin platform hooks: nav: "projects", provides: {"services.index": "…"}, tag: "service" claimability, hub/services/commits, hub/conversations services filtering, and aiAgentPlugin.open() / openTag(). A standalone hub without the services plugin now exposes zero homelab services UI or endpoints.

Key changes

  • Backend retirement & slim host plumbing: deleted backend/services/ (catalog.py, enrich.py, routes.py), backend/schemas/services.py, backend/test_services_plugin_host.py, and removed /api/services + /api/service from backend/main.py, backend/authz/routes.py, backend/authz/matrix.golden.txt, and OpenAPI/generated frontend DTOs. Extracted minimal SERVICES_DIR + cached git history helpers into backend/servicesdir.py for low-level core consumers (artefacts.py, hostfiles.py, plugins/runner.py, goals/routes.py).
  • Generic plugin platform hooks:
    • backend/plugins/manifest.py: added "projects" to _NAV_GROUPS, removed "service" from _CORE_TAG_KINDS (allowing a plugin page to claim tag: "service"), replaced provides: service.cards with provides: services.index, and retired service.card/service.detail slot places.
    • backend/plugins/services_bridge.py + GET /api/plugins/services-index (backend/plugins/routes.py): 30 s SWR-cached bridge over provides: services.index, consumed by goals/routes.py, plugins/graphdata.py, cli/tag_looks.py, and frontend composer/tags (only when usePluginProvides("services.index") is active).
    • backend/plugins/proxyroutes.py: added GET …/hub/services/commits[?slug=] under services.read (cached githist.BucketedHistory) and added services + ?service=<slug> filtering to hub/conversations under conversations.read.
    • frontend/src/business/plugins/components/PluginSandboxFrame.tsx: added init.tagPages, init.openers, aiAgentPlugin.open(kind, params), and aiAgentPlugin.openTag(kind, slug) so plugin frames never hardcode another plugin's URLs.
  • Frontend Projects-only & nav: "projects":
    • Updated nav.ts, ProjectsPanel.tsx, DashboardsPanel.tsx, and BottomBar so nav: "projects" plugin pages appear as top shortcuts in the Projects drawer and in the Projects bottom-bar sub-drawer.
    • Simplified Projects.tsx to Projects-only; deleted Service.tsx and /services* routes in root.tsx.
    • Updated lib/tags.ts, ConvMetaBits.tsx, SpawnComposer.tsx, opener.ts, lib/queries.ts, api.ts, and the mock backend (mock/servicesPlugin.ts, mock/plugins.ts, mock/handlers.ts).
  • CLI & MCP: cli/ai_agent.py ai-agent services now prints a pointer to ai-agent plugin services ls|show (exit 2); cli/mcp_tools.py removes "services" from browse (replaced by plugin MCP tools plugin_services_ls / plugin_services_show); cli/tag_looks.py reads /api/plugins/services-index.
  • Docs & tests: added backend/test_services_plugin_bridge.py (13 tests), frontend/src/lib/tags.test.ts, and updated CLAUDE.md and docs/plugins.md.

Key decisions

  • Full catalog migration (provides: services.index + nav: "projects") (Gabriel's form move-services-fully-to-plugin_j2oy8p): rather than keeping /api/services and a core page shell, core holds zero Services UI or catalogue endpoints; graph, goals, tags, and SpawnComposer degrade cleanly to empty when the plugin is off.
  • No legacy /services/* redirects: follows the 2026-11-27 "core names no plugin page" rule; removing "service" from _CORE_TAG_KINDS lets the services plugin claim tag: "service" (subpath: true) so all service: pills link dynamically.
  • Generic open() / openTag() frame bridges: keeps cross-plugin navigation (services → diff-viewer commits, goals/graph/memories → services) free of hardcoded plugin routes.
  • Companion PR required: merge together with ai-agent-plugins branch services-plugin-full (services 2.0.0, memories 1.3.0, goals 1.4.0, graph 1.4.0) and reload those 4 plugins after deploy.

Changelog

  • Added: nav: "projects" plugin page placement (Projects drawer shortcut + Projects bottom-bar sub-drawer) and aiAgentPlugin.open() / openTag() cross-plugin navigation bridges.
  • Changed: Projects landing page and drawer now show Projects only; service: pills link dynamically to whichever plugin claims tag: "service".
  • Removed: Core Services UI (Service.tsx, Projects & Services toggle), /services* routes, /api/services & /api/service, core ai-agent services CLI, and MCP browse services (all moved to the services live plugin).

Test notes

  • Backend full suite (scripts/test.py, 166 modules): 2,095 passed, 1 skipped, 0 failed (including 13 new tests in backend/test_services_plugin_bridge.py).
  • CLI (pytest cli/): 112 passed (3 pre-existing test_conv_ref.py failures identical on main).
  • Frontend: OpenAPI re-dumped and npm run gen:api regenerated cleanly; npx tsc --noEmit clean; npm run build clean; npx vitest run 1,084 passed (3 pre-existing failures identical on main).
  • Visual verification: tested in ?mock=1 on EVOX2 with dev-up --recipe mock and GPU Chromium screenshot (with the companion services 2.0.0 ui/services.html and icon.svg); screenshots attached below.
  • Not deployed (developed on EVOX2 — deploy from the Homelab after merging both PRs and reload services, memories, goals, graph).

Screenshots

pr-projects.png
pr-services-list.png
pr-services-detail.png

## Summary Completes the migration of the homelab Services catalogue out of `ai-agent` core into the `services` live plugin (`ai-agent-plugins` PR companion). Core retires `backend/services/`, `/api/services`, `/api/service`, `Service.tsx`, the Projects & Services split UI, `/services*` routes, `ai-agent services`, and MCP `browse services`, replacing them with generic plugin platform hooks: `nav: "projects"`, `provides: {"services.index": "…"}`, `tag: "service"` claimability, `hub/services/commits`, `hub/conversations` `services` filtering, and `aiAgentPlugin.open()` / `openTag()`. A standalone hub without the `services` plugin now exposes zero homelab services UI or endpoints. ## Key changes - **Backend retirement & slim host plumbing**: deleted `backend/services/` (`catalog.py`, `enrich.py`, `routes.py`), `backend/schemas/services.py`, `backend/test_services_plugin_host.py`, and removed `/api/services` + `/api/service` from `backend/main.py`, `backend/authz/routes.py`, `backend/authz/matrix.golden.txt`, and OpenAPI/generated frontend DTOs. Extracted minimal `SERVICES_DIR` + cached git history helpers into `backend/servicesdir.py` for low-level core consumers (`artefacts.py`, `hostfiles.py`, `plugins/runner.py`, `goals/routes.py`). - **Generic plugin platform hooks**: - `backend/plugins/manifest.py`: added `"projects"` to `_NAV_GROUPS`, removed `"service"` from `_CORE_TAG_KINDS` (allowing a plugin page to claim `tag: "service"`), replaced `provides: service.cards` with `provides: services.index`, and retired `service.card`/`service.detail` slot places. - `backend/plugins/services_bridge.py` + `GET /api/plugins/services-index` (`backend/plugins/routes.py`): 30 s SWR-cached bridge over `provides: services.index`, consumed by `goals/routes.py`, `plugins/graphdata.py`, `cli/tag_looks.py`, and frontend composer/tags (only when `usePluginProvides("services.index")` is active). - `backend/plugins/proxyroutes.py`: added `GET …/hub/services/commits[?slug=]` under `services.read` (cached `githist.BucketedHistory`) and added `services` + `?service=<slug>` filtering to `hub/conversations` under `conversations.read`. - `frontend/src/business/plugins/components/PluginSandboxFrame.tsx`: added `init.tagPages`, `init.openers`, `aiAgentPlugin.open(kind, params)`, and `aiAgentPlugin.openTag(kind, slug)` so plugin frames never hardcode another plugin's URLs. - **Frontend Projects-only & `nav: "projects"`**: - Updated `nav.ts`, `ProjectsPanel.tsx`, `DashboardsPanel.tsx`, and `BottomBar` so `nav: "projects"` plugin pages appear as top shortcuts in the Projects drawer and in the Projects bottom-bar sub-drawer. - Simplified `Projects.tsx` to Projects-only; deleted `Service.tsx` and `/services*` routes in `root.tsx`. - Updated `lib/tags.ts`, `ConvMetaBits.tsx`, `SpawnComposer.tsx`, `opener.ts`, `lib/queries.ts`, `api.ts`, and the mock backend (`mock/servicesPlugin.ts`, `mock/plugins.ts`, `mock/handlers.ts`). - **CLI & MCP**: `cli/ai_agent.py` `ai-agent services` now prints a pointer to `ai-agent plugin services ls|show` (exit 2); `cli/mcp_tools.py` removes `"services"` from `browse` (replaced by plugin MCP tools `plugin_services_ls` / `plugin_services_show`); `cli/tag_looks.py` reads `/api/plugins/services-index`. - **Docs & tests**: added `backend/test_services_plugin_bridge.py` (13 tests), `frontend/src/lib/tags.test.ts`, and updated `CLAUDE.md` and `docs/plugins.md`. ## Key decisions - **Full catalog migration (`provides: services.index` + `nav: "projects"`)** (Gabriel's form `move-services-fully-to-plugin_j2oy8p`): rather than keeping `/api/services` and a core page shell, core holds zero Services UI or catalogue endpoints; `graph`, `goals`, `tags`, and `SpawnComposer` degrade cleanly to empty when the plugin is off. - **No legacy `/services/*` redirects**: follows the 2026-11-27 "core names no plugin page" rule; removing `"service"` from `_CORE_TAG_KINDS` lets the `services` plugin claim `tag: "service"` (`subpath: true`) so all `service:` pills link dynamically. - **Generic `open()` / `openTag()` frame bridges**: keeps cross-plugin navigation (`services` → `diff-viewer` commits, `goals`/`graph`/`memories` → `services`) free of hardcoded plugin routes. - **Companion PR required**: merge together with `ai-agent-plugins` branch `services-plugin-full` (`services` 2.0.0, `memories` 1.3.0, `goals` 1.4.0, `graph` 1.4.0) and reload those 4 plugins after deploy. ## Changelog - Added: `nav: "projects"` plugin page placement (Projects drawer shortcut + Projects bottom-bar sub-drawer) and `aiAgentPlugin.open()` / `openTag()` cross-plugin navigation bridges. - Changed: Projects landing page and drawer now show Projects only; `service:` pills link dynamically to whichever plugin claims `tag: "service"`. - Removed: Core Services UI (`Service.tsx`, Projects & Services toggle), `/services*` routes, `/api/services` & `/api/service`, core `ai-agent services` CLI, and MCP `browse services` (all moved to the `services` live plugin). ## Test notes - Backend full suite (`scripts/test.py`, 166 modules): **2,095 passed, 1 skipped, 0 failed** (including 13 new tests in `backend/test_services_plugin_bridge.py`). - CLI (`pytest cli/`): **112 passed** (3 pre-existing `test_conv_ref.py` failures identical on `main`). - Frontend: OpenAPI re-dumped and `npm run gen:api` regenerated cleanly; `npx tsc --noEmit` clean; `npm run build` clean; `npx vitest run` **1,084 passed** (3 pre-existing failures identical on `main`). - Visual verification: tested in `?mock=1` on EVOX2 with `dev-up --recipe mock` and GPU Chromium `screenshot` (with the companion `services` 2.0.0 `ui/services.html` and `icon.svg`); screenshots attached below. - **Not deployed** (developed on EVOX2 — deploy from the Homelab after merging both PRs and reload `services`, `memories`, `goals`, `graph`). ## Screenshots ![pr-projects.png](https://git.gabvdl.xyz/attachments/5261f423-d77b-40ef-9876-7130a9301a07) ![pr-services-list.png](https://git.gabvdl.xyz/attachments/0080046b-8583-4d55-9f52-723c610ec504) ![pr-services-detail.png](https://git.gabvdl.xyz/attachments/fb44567b-ace2-4068-ac7e-78adc3075423)
gabrielvidal self-assigned this 2026-11-28 02:14:53 +01:00
gabrielvidal added 1 commit 2026-11-28 02:14:53 +01:00
Author
Owner
Merged into `main` as 69b4e6c4 by the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/cd30f3f6-6be0-4c6c-a3d7-1ee539f52a57.
gabrielvidal closed this pull request 2026-11-28 02:34:07 +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#31