Summary
Introduce a small plugin API that lets consumers run middleware around chat messages without forking the widget. Both client-side (widget) and server-side (worker) extension points should be supported.
Motivation
Customers want to inject context, redact PII, route to different models, log analytics events, and inject canned responses for specific intents. A plugin system makes Claudius extensible without bloating the core.
Acceptance Criteria
Summary
Introduce a small plugin API that lets consumers run middleware around chat messages without forking the widget. Both client-side (widget) and server-side (worker) extension points should be supported.
Motivation
Customers want to inject context, redact PII, route to different models, log analytics events, and inject canned responses for specific intents. A plugin system makes Claudius extensible without bloating the core.
Acceptance Criteria
ClaudiusPlugininterface with lifecycle hooks:onBeforeSend(message, ctx),onAfterReceive(message, ctx),onError(err, ctx)ChatWidgetaccepts aplugins: ClaudiusPlugin[]prophonomiddleware formpluginAnalytics,pluginRedactPII,pluginCannedResponses