Plugin contributions
A definePlugin closure can contribute to six surfaces. Each surface is owned by a different @nwire/* package — knowing which package owns what helps you understand why an import resolves where it does, and which surfaces are available in a slim runtime (e.g. when you skip @nwire/forge and use @nwire/app standalone).
| Surface | Builder method | Owning package | Required when |
|---|---|---|---|
| DI bindings | bind(token, factory) | @nwire/container | Any plugin that exposes a service |
| Framework events | on(EventKind, fn) | @nwire/app | Reacting to lifecycle |
| Action events | before/after(action, fn) | @nwire/forge | Cross-cutting policy / audit |
| HTTP middleware | middleware(fn) | @nwire/http | Request-scoped logic |
| Actor hooks | actorHooks({ onLoad, onSave }) | @nwire/forge | Aggregate observability |
| Route mounts | routes(api => ...) | @nwire/http | Plugins shipping endpoints |
| Named hooks | hooks(reg => ...) | @nwire/forge | Pipelines + extension points |