Glossary
This page defines the terms the NetScript docs use, maps each one to the file or API it lives in, and links to the page that teaches it. Use it as a lookup: when a page uses a word such as contribution, single-active-backend, or durability tier, find its precise meaning here, then follow the link back.
Core vocabulary
These are the terms you meet first, in the Quickstart, the tutorials, and the architecture overview.
| Name · Type | Description |
|---|---|
AppHostaspire/apphost.mts |
The Aspire orchestration entry point. It boots the whole workspace (Postgres, Redis, services, and plugin processors) as one resource graph with a dashboard at the URL Aspire prints. In NetScript the AppHost is a generated Node/TypeScript file, aspire/apphost.mts, driven by aspire.config.json and appsettings.json, not a dotnet project. Start it with cd aspire && aspire start, before any netscript db command. See Concepts → Orchestration with Aspire and reference/aspire/. |
archetypepackage classification |
The architectural category of a package or plugin, such as a contract unit, an adapter, a runtime, or a plugin. It determines the public surface, the quality gates, and the allowed dependencies. Archetype is a framework-internal term; as an app author you meet it mostly through the shape of a scaffolded plugin. See Concepts → Plugin system. |
Aspireaspire start |
The orchestration layer NetScript uses for local development. It provisions your database and Redis as Docker containers and wires every service and plugin processor together with health, logs, and OTLP traces, without a manual docker compose. Postgres is the recommended engine; mysql and mssql, selected with --db, are also container resources, and sqlite is file-backed with no container. To opt out, scaffold with netscript init --no-aspire for a leaner single-process loop. See Concepts → Orchestration with Aspire and Build → Deploy a workspace. |
AuthBackendOperationUnsupportedErrortyped capability boundary |
The typed error a backend throws when you call an operation it doesn't implement, such as a session mutation on a stateless backend or an interactive sign-in on a non-interactive one. Missing surface in the single-active-backend capability matrix fails loudly instead of silently doing nothing. See Concepts → Auth model and the Build → Authentication export list. |
AuthBackendPort/plugin-auth-core/ports |
The one seam every authentication backend implements. Defined by @netscript/plugin-auth-core, it composes provider, session-store, crypto, and principal-mapper sub-ports, plus an authenticate(request) method and an optional interactive flow. Backends are pure adapters behind this port; the host never special-cases a vendor. See Build → Authentication and Concepts → Auth model. |
AuthSession/plugin-auth-core/domain |
The domain record for an authenticated session: id, user, account, and state (active | expired | revoked), defined as a Zod-validated type in @netscript/plugin-auth-core. The session store reads and writes this shape, and the auth stream projects it. See Concepts → Auth model and Build → Authentication. |
capabilityBuild area |
A first-class feature of NetScript: services, background jobs, durable sagas, triggers, streams, authentication, database, KV/queues/cron, telemetry, and the Fresh UI. Each capability belongs to an area of Build, with guides that explain it and recipes that each solve one task with it. |
compensation-as-effecthandler return value |
How the scaffolded saga sample models rollback. Instead of an explicit .step() / .compensate() chain, a message handler returns an array of effects, such as sagaComplete({...}), that the runtime applies. Compensation is one more effect a handler can emit. See Concepts → Durability model. |
composition rootnetscript.config.ts |
The one place where a NetScript app is assembled. defineConfig({...}) declares the project name, path layout, logging, databases, and plugin entrypoints such as generated ./auth/mod.ts glue or author-owned ./plugins/<name>/mod.ts. The runtime reads it to learn what your app is made of. See Concepts → Architecture and reference/config/. |
contractoc.route().input().output() |
The versioned, schema-first definition of an API, built with @orpc/contract and zod in contracts/versions/v1/. It fixes the request and response shape before any handler exists. implement(Contract) produces the object whose .handler(...) methods the service router binds, so the client and the server share one source of truth. See Concepts → Contracts & type flow and reference/contracts/. |
contributionplugin manifest export |
A typed unit of functionality that a plugin contributes to the host: a job, a saga, a webhook trigger, a route, an Aspire resource, or a database schema. The plugin's mod.ts manifest exposes it so the runtime can discover and wire it. The auth plugin, for instance, contributes a service and durable stream events, plus a Prisma schema only for the better-auth backend. See Concepts → Plugin system. |
| Name · Type | Description |
|---|---|
durability tier.durability('t1') |
The persistence guarantee a saga declares in its builder chain, for example 't1' in defineSaga(id).durability('t1'). It tells the runtime how durably to checkpoint the saga's state across messages. It is distinct from the saga store backend (kv | prisma), which is where that state is written. See Concepts → Durability model and Build → Durable sagas. |
durablesaga state checkpointing |
Work that survives process restarts because its progress is persisted, not held only in memory. NetScript sagas are durable: the runtime checkpoints their state, per the chosen durability tier, to the saga store backend (kv or prisma), so a long-running, message-driven workflow can resume after a crash. See Concepts → Durability model. |
InteractiveFlowPortoptional AuthBackendPort member |
The optional sub-port a backend implements to drive a redirect-based sign-in: the signIn / handleCallback / getSessionId / signOut flow. Only the kv-oauth backend exposes it. On workos and better-auth, the signin and callback endpoints return a typed provider error because those backends have no interactive flow. See Concepts → Auth model. |
jobdefineJobHandler(async (ctx) => …) |
A unit of background work authored with @netscript/plugin-workers-core. It returns createSuccessResult({...}) or createFailureResult(...) and gets its id from Object.assign(handler, { id }). Jobs run on the workers processor and are triggered over HTTP at POST /api/v1/workers/jobs/{id}/trigger on the workers plugin's assigned port. Job dispatch and execution emit OpenTelemetry spans (see OTel / observability). See Tutorial → Background jobs and Build → Background jobs. |
| Name · Type | Description |
|---|---|
manifestplugins/<name>/mod.ts |
A plugin's public face: its mod.ts, which exports the plugin object (for example workersPlugin or authPlugin), an inspector (inspectWorkers, inspectAuth), and the contribution types the host discovers. The composition root references each plugin by its manifest path, and a generated registry aggregates them. See Concepts → Plugin system. |
oRPC/contract · /server |
The contract-and-RPC toolkit (@orpc/*) behind NetScript's typed APIs. You declare contracts with oc.route().input().output(), implement them with implement(...), serve them with defineService or createService, and call them through a typed client. Workers, sagas, the auth service, and triggers all expose oRPC under /api/rpc/*. The one exception is the triggers plugin's raw, HMAC-verifying webhook ingress endpoint. See Concepts → Contracts & type flow. |
opaque session token (HMAC)createHmacSessionTokenCrypto(secret) |
The default session-token scheme in the auth core: a WebCrypto HMAC-SHA256 token that carries no readable claims and is verified server-side against a secret. AuthSessionCryptoPort produces it by default, so a stolen token reveals nothing and can't be forged without the secret. See Concepts → Auth model and Build → Authentication. |
pluginpackage + generated glue |
An installable, thread-isolated capability. Public workspaces install plugin packages with commands such as netscript plugin install @netscript/plugin-workers, which add the dependency and emit user-owned glue and sample files that import the package. Local-source contributor samples use deno run -A packages/cli/bin/netscript-dev.ts plugin install worker --name workers --samples. The plugin's contracts, services, runtime entrypoints, and Prisma schema stay in the installed package unless you author or sync full source. See Concepts → Plugin system and Build → Add a plugin. |
Principal/service/auth |
The authenticated identity an authenticator resolves from a request: id, scopes, and a scheme ('api-key' | 'bearer' | 'trusted-header' | 'custom'). The auth-plugin backends map their sessions to a Principal with scheme: 'custom', so service-layer authorization treats vendor-backed identities the same way. See Concepts → Auth model. |
| Name · Type | Description |
|---|---|
registrygenerated registry file |
A generated index the runtime reads to discover what your app contains, without runtime reflection. netscript plugin list emits the plugin registry, and the workers profile generates a jobs registry (for example .netscript/generated/plugin-workers/job-registry.ts, keyed by job id). Registries are derived artifacts: regenerate them instead of editing them by hand. See Concepts → Plugin system. |
sagadefineSaga(id)…build() |
A durable, message-driven workflow authored with the fluent builder from @netscript/plugin-sagas-core: defineSaga(id).durability('t1').state<S>({...}).on<Type,Payload>(type, handler).build(). Each .on(...) handler reacts to a message and returns effects such as sagaComplete({...}). Runtime state persists to the chosen saga store backend (kv | prisma). The sagas service lists registered sagas at /api/v1/sagas/sagas on the sagas plugin's assigned port. See Tutorial → Durable workflow and Build → Durable sagas. |
saga store backendNETSCRIPT_SAGA_STORE=kv|prisma |
Where a durable saga runtime persists its checkpointed state: 'kv' or 'prisma', selected with NETSCRIPT_SAGA_STORE (or appsettings sagas.store.backend) and constructed with createDurableSagaRuntime({ backend, prisma }). The selection is mandatory: the runtime throws if it is unset, and Prisma mode requires a client. It is distinct from a saga's durability tier. See Build → Durable sagas and Concepts → Durability model. |
servicedefineService(router, {...}) |
An oRPC HTTP application. Local app services use a one-shot defineService(router, { name, version, port, openapi }) call, as the users service does on its assigned port. Plugin API services use the fluent createService(router, {...}).withCors()…serve() builder, so one project has two construction APIs. oRPC is served at /api/rpc/*, and the service layer offers an authentication and authorization middleware seam (.withAuthn() / .withAuthz()). See Build → Services & contracts and reference/service/. |
single-active-backendNETSCRIPT_AUTH_BACKEND |
The hard v1 boundary of the auth plugin: exactly one authentication backend is active at a time, kv-oauth (default), workos, or better-auth, chosen with NETSCRIPT_AUTH_BACKEND (or appsettings auth.backend). The unified auth oRPC service answers on its assigned port. There is no multi-active routing, cross-backend account linking, global logout, or historical session replay. See Build → Authentication and Concepts → Auth model. |
streamcreateDurableStream({...}) |
A typed, durable event stream. createDurableStream({ streamPath, schema, producerId }) from @netscript/plugin-streams-core writes durable entity state; it runs as an Aspire service on its assigned port and is wired into workers, auth, and sagas. @netscript/plugin-streams carries the service manifest and typed topic definitions, and consumers read over HTTP/SSE. See Build → Durable streams and reference/streams/. |
| Name · Type | Description |
|---|---|
triggerdefineWebhook(handler, {...}) |
An inbound event source, most often a webhook, authored with defineWebhook(handler, { id, path, verifier, tags }) from @netscript/plugin-triggers-core/builders. The handler returns effects that either enqueueJob(jobRef, { payload, priority }) immediately or defer({ until }) a durable one-shot replay. Like workers and sagas, the triggers service serves a typed v1 oRPC contract for trigger and event introspection and management on its assigned port. The exception is the raw, HMAC-verifying webhook ingress endpoint, POST /api/v1/webhooks/:triggerId. See Tutorial → Ingest a webhook and Build → Event triggers. |
zodz.object({...}) |
The schema library NetScript uses to declare and validate inputs and outputs at runtime. It is the runtime half of a contract. See Concepts → Contracts & type flow. |
Less common terms
These terms appear once you go past the happy path: the toolchain, the data layer, the auth seams, and the moving parts under a running plugin.
| Name · Type | Description |
|---|---|
appsettings.jsoninfra config |
The root infrastructure manifest that the Aspire AppHost reads. It declares NetScript.Databases (engine, container mode, and primary database; Postgres is recommended, or mysql / mssql / sqlite selected with --db at scaffold time), NetScript.Cache (redis by default; garnet or deno-kv with --cache-backend), the services, and each plugin's Workdir. Backend selections such as sagas.store.backend and auth.backend can live here too. The databases block in netscript.config.ts is intentionally near-empty; the live database and cache configuration is here. See Concepts → Orchestration with Aspire. |
auth backend/auth-* |
A pure adapter that implements AuthBackendPort: kv-oauth (interactive OAuth/OIDC redirect flow with KV sessions, and the only backend that exposes InteractiveFlowPort), workos (AuthKit sealed cookie, non-interactive), or better-auth (Prisma-backed, non-interactive). The plugin composes exactly one (see single-active-backend) and serves the unified auth oRPC surface on its assigned port. See Concepts → Auth model and Build → Add authentication. |
background processorbin/combined.ts |
The separate, long-running process that executes a plugin's work, apart from its HTTP API service. Generated projects start workers/runtime.ts, sagas/runtime.ts and triggers/runtime.ts. The packaged plugin entrypoints are: workers bin/combined.ts, sagas src/runtime/saga-runner.ts, and triggers src/runtime/trigger-processor.ts. The AppHost starts each one as its own Aspire resource. See Concepts → Plugin system. |
GarnetCache.garnet (KV) |
One of the Redis-compatible cache and KV backends that Aspire can provision as a container alongside Postgres. The default is redis; select Garnet with --cache-backend garnet. It holds executions, saga registry metadata, kv-oauth sessions, and Deno KV-backed state. See Build → KV, queues & cron and reference/kv/. |
OTel / observability/telemetry |
OpenTelemetry tracing built into the framework. Job dispatch, execution, step events, progress, scheduler runs, and subprocess trace continuation emit spans, which appear in Aspire automatically (OTLP endpoint at the OTLP URL Aspire prints). The scaffold's createJobTools(ctx) handler helpers add custom events, progress, and child spans to the active job trace; their log.* surface stays console-backed. See Concepts → Observability model and Build → Telemetry & logging. |
Prisma (Deno runtime)database/postgres/schema/ |
The ORM layer, over a choice of databases. You choose the engine at scaffold time with --db: postgres (the recommended default; Prisma provider postgresql), mysql, mssql (provider sqlserver), or sqlite (file-backed, with no Aspire container resource). The Prisma authoring model is the same for every engine. The root schema sets generator client { runtime = "deno" } plus a zod generator, and each plugin contributes its own .prisma models under schema/plugins/<plugin>/; the auth plugin installs SQL tables only for better-auth: auth_users / auth_sessions / auth_accounts / auth_verifications. Generate the typed client with netscript db generate once Aspire is up. See Build → Database & Prisma and reference/database/. |
queue providerQueueProvider.Postgres |
The transport that createQueue('name', { provider }) binds to, one of four backends: Deno KV, Redis, RabbitMQ, and PostgreSQL (provider: 'postgres', connection.postgres.{url,tableName}). Postgres is available only as an explicit provider: auto-discovery probes RabbitMQ, then Redis, then Deno KV, and never picks Postgres. See Build → KV, queues & cron and reference/queue/. |