Building plugins
This guide covers a minimal provider or hook plugin for self-hosted Carina.
Manifest
Place a folder under ~/.carina/plugins/my-plugin/:
my-plugin/
package.json
index.mjs
carina.plugin.json
Example carina.plugin.json:
{
"id": "my-plugin",
"version": "1.0.0",
"hooks": ["message:in"],
"provides": []
}
Hook example
export default {
id: 'my-plugin',
onHook(event, ctx) {
if (event === 'message:in') {
ctx.log.info('Inbound message', ctx.sessionId);
}
},
};
Provider plugin
Implement the provider factory interface expected by plugins/loader.ts and register via CARINA_PROVIDER_PLUGINS=/path/to/plugin.
See existing provider plugins in the core repo for reference implementations.
Testing
carina hooks listshould show your plugin id- Trigger the hook with a test message
- Run
carina doctorafter install
Publishing
Internal plugins: commit beside your deployment config. Public plugins: publish to npm and document env vars in README.
Safety
Plugins run with gateway privileges. Review code before enabling in production; use Scout tool policy to limit exfiltration.