Home · Developers · Guides · Plugin Authoring, extension points

Extensibility

Plugin Authoring, extension points

Writing a plugin

Three supported ways to extend Nova Coder (per reports/Plugin and Extension SDK.md). Pick by where the behavior lives.

1. Route module (new HTTP surface)

# novacoder/api/routes_mysurface.py
from fastapi import APIRouter
router = APIRouter()

@router.get("/api/mysurface/hello")
async def hello() -> dict:
    return {"ok": True}
  • Register the module name in _ROUTE_MODULE_NAMES (novacoder/api/app.py), unregistered modules 404 silently.
  • /api/* paths are token-gated automatically; anything outside /api must be added to non_api_protected or is public (scanner-enforced).
  • Route handlers returning FileResponse|JSONResponse need response_model=None.

2. Kernel service (lifecycle + DI)

from novacoder.kernel.service import NovaService

class MyService(NovaService):
    name = "myservice"
    def initialize(self) -> None: ...
    def start(self) -> None: ...       # must not run async work
    def stop(self) -> None: ...
  • Register in SERVICE_ORDER (app.py); resolve deps via container.
  • start() runs inside synchronous _boot(), async health checks at boot deadlock the API (ADR-002).
  • Heavy work belongs on the scheduler, not in initialize().

3. Capability (model-facing tool)

from novacoder.capabilities.base import Capability
from novacoder.capabilities.descriptor import CapabilityDescriptor, CapabilityResult

class MyCap(Capability):
    descriptor = CapabilityDescriptor(
        id="mine.thing", name="My Thing", description="…",
        keywords=["do my thing"],            # feeds the IntentRouter
        requires_approval=True,              # if it mutates
    )
    async def run(self, args, ctx) -> CapabilityResult: ...
  • Register in builtins/__init__.py::register_builtins (or adopt a legacy tool).
  • Honor the gates: SSRF for egress, path confinement for filesystem, device ops surface for host actions, never raw fs/subprocess.
  • Missing backends must report unavailable, not crash.

Source: wiki/plugin-authoring.md · rendered 2026-11-10