Skip to content

Packages

Every published @nwire/* package, grouped by role. The npm name drops the folder's role prefix.

Core

Foundation primitives every app builds on.

  • @nwire/app — managed Container with plugin lifecycle, framework hooks, and DI. Composes apps + plugins, boots in order, exposes a Container, fires framework hooks at every lifecycle transition.
  • @nwire/config — typed configuration layer. env reader with coercion + aggregated fail-fast, defineConfig slices, loadConfig registry. Laravel/Adonis-grade configuration for @nwire apps.
  • @nwire/container — DI container contract + Awilix-backed default. Generic over TCradle; ships scope hierarchy, lazy cradle proxy, lifetimes, disposers via Awilix.
    Imports: @nwire/container, @nwire/container/awilix
  • @nwire/endpoint — production process lifecycle. Wraps any Node server (Express, Fastify, Koa, Nest, Nwire interfaces) with K8s-grade graceful shutdown, http-terminator drain, and lightship readiness/liveness probes. Standalone — no framework dependency beyond @nwire/container.
  • @nwire/envelope — universal message envelope. messageId, correlationId, causationId, tenant, userId. Zero-dep; every nwire package depends on this.
  • @nwire/forge — the CQRS battery. Actors, projections, workflows, queries, and the action pipeline, plus outbox/inbox/cron, invariants, and DLQ wiring — installed via forgePlugins / withForge. Opt-in; an app boots without it. The runtime is the bus.
  • @nwire/handler — the operation primitive. Typed, callable, hookable value built on @nwire/hooks. defineHandler / defineError / defineResource / response factories / framework errors. Standalone; every transport (HTTP, queue, MCP, CLI) speaks the same handler shape.
  • @nwire/hooks — the universal dispatch primitive. One hook() accepts both .use() (sequential koa-compose chain) and .on() (parallel listener) attachments. Lazy-memoized chain compose, per-step observation tap, AsyncLocalStorage-linked run topology. In-process only.
  • @nwire/logger — Logger contract + Noop + Console defaults. Production adapters: @nwire/logger-pino, @nwire/logger-winston. Envelope ids auto-attached via loggerForEnvelope.
  • @nwire/messages — typed command and event contracts. defineCommand, defineEvent with public/internal visibility. Zod-validated; shareable across the backend, frontends, BFFs.
  • @nwire/runtime — envelope-execution substrate. Dispatch + emit + when + sink + capability registry. Standalone — usable without the App layer.
  • @nwire/wires — transport-interface contract. InterfaceBuilder is the abstract base every transport (HTTP, queue, MCP, GraphQL, …) extends. Foreign hosts implement it. Six universal verbs (.use / .wire / .from / .mount / .run / .boot) plus manifest + attach seams are typed at this layer so transports stay consistent.
    Imports: @nwire/wires, @nwire/wires/http, @nwire/wires/queue, @nwire/wires/cron, @nwire/wires/mcp, @nwire/wires/graphql

Adapters & libraries

Opt-in transports, stores, and integrations behind contracts.

  • @nwire/amqp — RabbitMQ-backed EventBus adapter. Topic exchange pub/sub with optional durable queues — same EventBus contract as @nwire/nats.
  • @nwire/apollo — Apollo Server (v4) interop adapter. actionResolver(action) plugs a Nwire ActionDefinition into a GraphQL schema as a field resolver; nwireApolloContext({ runtime }) adds the runtime + a seeded envelope to Apollo's per-request context; mountNwireOnApollo() registers Nwire-aware error mapping (defineError -> extensions.code). Opt-in, peer dep, ~60 LOC of real code.
  • @nwire/auth — authorization contract + middleware. Authorizer interface (throw-on-deny) + authzMiddleware. Per-action policy tag is opaque to the framework; the authorizer decides what each tag means.
  • @nwire/auth-better-auth — better-auth adapter. Wraps a configured better-auth instance as an IdpAdapter so canonical resolvers (SignIn/SignOut/Register/Refresh/Me/etc.) work against better-auth's database-first auth backend. For self-hosted apps that don't want a separate IdP service.
  • @nwire/auth-logto — Logto auth adapter. Verifies Logto-issued JWTs via JWKS; maps Logto claims (sub, email, roles, scope) to the canonical User; runs sign-out + refresh via Logto's OIDC endpoints. Sign-in is the hosted UI redirect flow; this adapter does not implement password grant.
  • @nwire/bullmq — BullMQ-backed QueueTransport for production. Redis-backed durable queues + delayed jobs (timer scheduler) + failed-jobs board.
  • @nwire/bus — cross-service event bus contract. EventBus interface + InMemoryEventBus default. Production adapters land as @nwire/nats, @nwire/bus-redis, @nwire/bus-kafka.
  • @nwire/cache — key/value cache contract + InMemoryCache (TTL) default + cachePlugin. Adapters (Redis/Valkey/Upstash) live in separate packages.
  • @nwire/cli — CLI — branded TUI. Dev, run, please, build, test, fmt, lint, check, ps, logs, cache, ls, studio. One surface for the whole framework.
  • @nwire/cron — cron interface factory. Dispatch actions on a schedule (croner-backed).
  • @nwire/dead-letter — DLQ contract + InMemory default. Production adapters: @nwire/dlq-mongo, @nwire/dlq-bullmq. The runtime routes exhausted-retry failures here.
  • @nwire/drizzle — Drizzle ORM adapter. Provider that registers a Drizzle client on the container, manages the connection pool lifecycle, and exposes optional readiness checks + telemetry. No Repository wrapper — handlers get the real Drizzle API.
  • @nwire/errors — Compatibility shim around @nwire/handler error definitions. New code should import the canonical singletons (Unauthorized, Forbidden, NotFound, Conflict, Gone, BadRequest) directly from @nwire/handler.
  • @nwire/express — Express-backed HTTP adopter. expressAdapter() consumes wires with binding.$adapter==='http' and mounts them on an Express server; fromExpressMiddleware() bridges Express middleware into httpKoa's middleware chain.
  • @nwire/koa — Koa-backed HTTP adopter. Consumes wires from @nwire/wires/http and serves them as Koa routes under endpoint lifecycle.
  • @nwire/logger-pino — Pino-backed Logger adapter. Production-grade structured logging; envelope ids auto-attached via child().
  • @nwire/mail — transactional-mail contract + InMemoryMailer default + mailPlugin. Adapters (SMTP/nodemailer, SES, SendGrid, …) live in separate packages.
  • @nwire/mail-nodemailer — Nodemailer-backed mail adapter. Implements the Mailer contract via nodemailer's transporter (SMTP/Mailhog/Gmail/Office365/...). Health-checked with transporter.verify(); graceful shutdown closes the pool.
  • @nwire/mcp — MCP (Model Context Protocol) server — exposes the kernel's CommandRouter as MCP tools over stdio. AI clients (Claude, Cursor, …) drive nwire commands the same way the CLI and Studio do.
  • @nwire/mongo — MongoDB adapters for ActorStore + ProjectionStore. (actorName, key, tenant) compound PK; fireAtList denormalized for indexable timer-scheduler queries; ensureIndexes() idempotent.
  • @nwire/nats — NATS-backed EventBus adapter. Core pub/sub OR JetStream (at-least-once + DLQ) — same EventBus contract.
  • @nwire/observability — dispatch tracing middleware. Logger-backed by default, with optional bridge to @opentelemetry/api (declared by the consumer, not by us).
  • @nwire/openapi — OpenAPI 3.1 generation from a Nwire wire collection. Transport-agnostic: reads app.interface.wires, picks the HTTP bindings, and emits a spec from binding metadata + zod schemas. Owns @asteasolutions/zod-to-openapi as a direct dependency, so any HTTP adopter (koa, express) or a CLI produces a spec with nothing extra to install.
  • @nwire/queue — queue transport contract + InMemory default + createQueueWorker. Production adapters land as @nwire/bullmq, @nwire/queue-sqs, @nwire/queue-pgboss.
  • @nwire/rbac — RBAC + permissions wrapped around CASL. defineAbility(user => ...) declares what each user can do; rbacPlugin enforces it on every dispatch.
  • @nwire/storage — object-storage contract + InMemoryStorage default + storagePlugin. Adapters (S3, filesystem) live in separate packages (@nwire/storage-s3, @nwire/storage-fs).
  • @nwire/storage-fs — local filesystem storage adapter. Implements the Storage contract against a base directory. Suitable for development, single-node deployments, and tests.
  • @nwire/storage-s3 — S3 storage adapter. Works with AWS S3, MinIO, Cloudflare R2, Backblaze B2, and anything else speaking the S3 API. Wraps @aws-sdk/client-s3 + @aws-sdk/s3-request-presigner.
  • @nwire/store-file — file-snapshot ActorStore + ProjectionStore. JSON snapshot persisted to disk with debounced writes. Survives process restart; tenant-partitioned. Dev/CI use, not production.
  • @nwire/telemetry — local telemetry reporters. Writes the canonical telemetry stream to disk as JSONL run files (.nwire/telemetry/<runId>.jsonl) for Studio history and post-mortem review. Cloud/OTLP forwarding lives in @nwire/telemetry-otel.
  • @nwire/telemetry-otel — OpenTelemetry bridge for the Nwire canonical telemetry stream. Translates every Telemetry record into OTLP spans + events. Plug in any OTEL exporter (Datadog, Honeycomb, Tempo, Vector → GreptimeDB).

Tools

The CLI, Studio, test kit, and scaffolders.

  • create-nwire — Scaffolder for new Nwire projects. Run pnpm create nwire &lt;name&gt; or npm create nwire &lt;name&gt; to bootstrap.
  • @nwire/please — operator CLI. runPlease dispatches actions/queries by name across all registered apps; --tenant for tenant scoping; --help lists everything.
  • @nwire/scan — system registry scanner. Walks AppDefinition[] manifests and writes the .nwire/ cache (actions, events, actors, projections, queries, routes, event graph). Vite plugin + standalone function.
    Imports: @nwire/scan, @nwire/scan/vite-plugin
  • @nwire/studio — visual companion for the framework. Vue 3 + Vite + shadcn-vue + VueFlow. System topology, action runner, actor browser, projection viewer, DLQ inspector.
  • @nwire/supervisor — Spawns and watches Nwire wire processes for dev tooling. Used by nwire dev and Studio's vite dev server. Generic process supervisor with stdout/stderr ring buffer, health-check polling, SIGTERM-then-SIGKILL graceful stop.
  • @nwire/test-kit — Shared test helpers and zod-driven fixture factories

49 packages.

MIT licensed.