Skip to main content
Alpha

Capabilities

A capability is a composable slice of the NetScript framework — a single, self-contained concern (defining a service, running background jobs, ingesting a webhook, authenticating a user, persisting state) that you add to a workspace without rewiring the host. Each capability owns one mental model, one headline authoring API, and — where it runs — one HTTP surface on a known port. You compose them the way you compose small building blocks: add what the system needs, leave out what it doesn't, and the contracts keep the seams type-safe.

This zone is the hub of hubs. Every page below is a capability hub built on the same shape — a one-screen concept, the headline API lifted verbatim from a scaffolded project, the real endpoints and ports, and a Learn / Do / Reference triplet that points you at the tutorial that teaches it, the how-to that ships it, and the generated API reference for the full surface. The hubs stay deliberately thin so they orient rather than duplicate the reference.

The five composable plugins

These are the slices you bolt on with netscript plugin add. Each is an isolated background processor or service that exposes its own HTTP API on a dedicated port, wired into Aspire automatically. Bring Aspire up first — cd aspire && aspire start provisions Postgres and a shared cache — redis by default, or garnet / deno-kv via --cache-backend — and starts the dashboard at http://localhost:18888before any netscript db command or plugin call, so the plugin services and their dependencies exist when you reach for them.

The platform capabilities

These ship with the scaffold — no plugin add required. Services and contracts are the backbone the five plugins lean on; the rest are the persistence, primitives, observability, and UI the whole workspace shares.

The capability matrix

At a glance: what each capability is for, how it runs, and where to read the full generated API. Ports apply only to capabilities that expose an HTTP surface; the primitive and UI capabilities run inside the workspace rather than on their own port. Always read the generated API reference for the exhaustive surface — these hubs orient, the reference enumerates.

All ten capabilities — kind, headline API, runtime surface, reference unit
NameTypeDescription
Services & contracts platform · :3001 defineService / createService().serve() + oRPC contracts via implement(); RPC at /api/rpc/*. Full API at /reference/service/ and /reference/contracts/.
Background jobs plugin · :8091 defineJobHandler + createSuccessResult; trigger via POST /api/v1/workers/jobs/{id}/trigger. Job/scheduler OTel spans are real. Full API at /reference/workers/.
Durable sagas plugin · :8092 defineSaga(id).durability('t1')...build(); durable store kv | prisma; list at /api/v1/sagas/sagas. Full API at /reference/sagas/.
Triggers & ingress plugin · :8093 (Hono) defineWebhook → enqueueJob; POST /api/v1/webhooks/inbound/generic. defer throws + DLQs. Full API at /reference/triggers/.
Durable streams plugin · :4437 createDurableStream producer runtime is real; plugin-streams manifest helpers throw StreamUnsupportedOperationError. Full API at /reference/streams/.
Authentication plugin · :8094 auth-api oRPC; /api/v1/auth/{signin,callback,signout,session,me}; one active backend (kv-oauth | workos | better-auth). Full API at /capabilities/auth/.
Database & Prisma platform · Postgres Prisma runtime="deno", per-plugin schema aggregation; Postgres is the default engine, with mysql / mssql / sqlite selectable via --db. Full API at /reference/database/.
KV, queues & cron platform · primitives Deno KV / queue (four backends incl. postgres) / cron behind unstable:["kv"]. Full API at /reference/kv/, /reference/queue/, /reference/cron/.
Telemetry & logging platform · OTel @opentelemetry/api spans + structured logs in handlers, RPC, and job dispatch. Full API at /reference/telemetry/ and /reference/logger/.
Fresh UI & design platform · copy-source Fresh + Preact + Tailwind v4 dashboard you own. Full API at /reference/fresh/ and /reference/fresh-ui/.

How the seams fit together

The plugins are not islands — they compose through the same contracts and durable substrate. A service defines an oRPC contract and serves it at /api/rpc/*. A trigger turns an inbound webhook into a queued job via enqueueJob. A worker picks that job off the queue and runs it thread-isolated, emitting real OTel spans as it goes. A saga drives a message-correlated state machine, persisting its durable state to kv or prisma. A stream producer mirrors execution state out of workers, auth, and sagas over the durable-streams service on :4437. And authentication sits in front as a pure-backend seam: the core defines AuthBackendPort, the three backends are pure adapters, and the plugin composes exactly one active backend at a time. Underneath them all, the platform capabilities — services, database, KV/queues/cron, telemetry, and the Fresh UI — supply the contracts, persistence, primitives, and observability the whole workspace shares.

Where to go next

The hubs are concept-first; the rest of the site does the teaching and the shipping. If you learn best by building, walk the tutorials ladder — it builds one continuous app where a service publishes a saga message, a saga consumes it, and a webhook enqueues a job, exercising several of these capabilities in sequence. If you have a task in hand, the how-to recipes ship each capability directly — including adding authentication. For the why behind the design, the core concepts zone explains the contract type flow, the plugin system, the durability model, the auth model, and the Aspire orchestration that ties it together.