# Mailcow Plugin Runtime v0.2.0

This build combines the original v0.1.0 runtime foundation with the v0.2.0 rendering layer.

## Included
- plugin runtime service
- plugin manifest schema + validator
- plugin registry APIs
- persisted plugin enabled state
- bootstrap hook loader with live mounting
- plugin asset serving under `/plugins/:id/ui/*`
- sample plugin: `owncloud-attach`
- mock ownCloud API endpoints for local integration work
- Dockerfile + compose
- Mailcow nginx proxy example
- install notes

## Core endpoints
- `/health`
- `/api/runtime/plugins`
- `/api/runtime/hooks`
- `/api/runtime/plugins/:id/enable`
- `/api/runtime/plugins/:id/disable`
- `/runtime/bootstrap.js`
- `/runtime/ui`
- `/plugins/owncloud-attach/api/me`
- `/plugins/owncloud-attach/api/files`
- `/plugins/owncloud-attach/api/select`

## What changed from v0.1.0
- hooks now resolve to structured contributions instead of plugin IDs only
- runtime serves plugin UI assets directly
- bootstrap script mounts real toolbar and attachment contributions
- plugin enable/disable state persists to `data/plugin-state.json`
- `owncloud-attach` includes working browser-side UI assets and reference API endpoints
- runtime exposes a Mailcow nginx snippet at `/mailcow/nginx.conf`

## Local run
```bash
cp .env.example .env
npm install
npm run build
npm start
```

Then open:
- `http://127.0.0.1:4110/runtime/ui`
