The core keeps the services index (names, README line, GOAL.md, last commit)
that service: tags, goals, artefacts and file chips need, and the service
page's shell (README, CLAUDE.md, commits, conversations, memories). Compose /
Traefik parsing, containers, URLs, auth chain, env keys and the file browser
(/api/service-file) leave services/catalog.py (667 → 186 lines) for the
services plugin in ai-agent-plugins.
Two plugin extension points make it work: provides.service.cards (the host
runs the plugin's action and merges whitelisted card fields into
/api/services and /api/service, services/enrich.py) and the services.read
capability (AIA_SERVICES_DIR for the owner's handler runs). ui.slots now
render (PluginSlots, service.detail with {slug}), and every plugin frame gets
the app's theme tokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
"""The services index (``services/catalog.py``) and the card fields the
|
|
``services`` plugin adds (``services/enrich.py``). The detail sections the
|
|
plugin's slot draws (containers, routers, files) are the plugin's own shapes."""
|
|
from __future__ import annotations
|
|
|
|
from typing import Literal, Optional
|
|
|
|
from .base import Schema
|
|
from .projects import GoalDetail, GoalSummary, ProjectCommit
|
|
|
|
__all__ = [
|
|
"ServiceSummary",
|
|
"ServiceDetail",
|
|
"ServicesResponse",
|
|
]
|
|
|
|
|
|
class ServiceSummary(Schema):
|
|
dir: str
|
|
name: str
|
|
description: str
|
|
goal: Optional[GoalSummary] = None
|
|
updatedAt: Optional[str] = None
|
|
# Filled by the services plugin (``provides: service.cards``); absent
|
|
# without it — a hub with no homelab, or the plugin switched off.
|
|
icon: Optional[str] = None
|
|
group: Optional[str] = None
|
|
urls: Optional[list[str]] = None
|
|
containers: Optional[list[str]] = None
|
|
containerCount: Optional[int] = None
|
|
images: Optional[list[str]] = None
|
|
profiles: Optional[list[str]] = None
|
|
auth: Optional[Literal["auth", "public", "api", "mixed"]] = None
|
|
hasCompose: Optional[bool] = None
|
|
hasTraefik: Optional[bool] = None
|
|
routerCount: Optional[int] = None
|
|
|
|
|
|
class ServiceDetail(ServiceSummary):
|
|
readme: Optional[str] = None
|
|
claudeMd: Optional[str] = None
|
|
goal: Optional[GoalDetail] = None
|
|
commits: list[ProjectCommit]
|
|
|
|
|
|
class ServicesResponse(Schema):
|
|
services: list[ServiceSummary]
|