NylorunDocsBeta
BuildRunDeployReferenceMore

Runtime

startRuntime options and the session-first HTTP route table.

@nylorun/runtime · beta
import { startRuntime } from "@nylorun/runtime/core";

const runtime = await startRuntime({
  sqlitePath: "./nylorun.sqlite",
  serverToken: process.env.NYLORUN_SERVER_KEY!,
  executors: [],
  port: 8787,
});

await runtime.close();

Runtime is an independent SQLite HTTP host. It consumes @nylorun/harness/run and @nylorun/core/contracts. It does not depend on @nylorun/agents. Generated projects do not import this package; @nylorun/cli starts @nylorun/runtime/server.

Requires Node 24+. Default address: http://127.0.0.1:8787.

startRuntime

OptionTypeRequiredDescription
sqlitePathstringYesSQLite file. Keep WAL/journal beside it.
serverTokenstringYesApplication bearer (≥16 characters).
executorsscoped { token, agentId, implementationVersion }[]YesProcess-only startup scopes. Empty is valid; register more with PUT /v1/executors.
modelModelProviderNoOptional provider. Omitted without useHostModel: scriptedModel().
useHostModelbooleanNoRead the host vault at call time.
leaseMsnumberNoExecutor claim lease.
vaultKek / vaultKekPathkey or pathNoVault encryption. null disables env/file lookup.
sandbox{ backend?, root? }Noauto (default), microsandbox, or virtual.
port / hostnamenumber / stringNoListen options. Default port 8787.

close() drains the host. It does not close application tools.

Removed from this family: httpModel, localSessions, in-process Runtime, serveAgents, openSession, and the AG-UI route.

HTTP routes

Authoritative contract: HOST_CONTRACT.md.

Unauthenticated

MethodPathResponse
GET/health{ status: "ok", service: "oss-runtime", version?, scopeId?, pid? }
GET/ready{ status: ready|not_ready, service, checks } — SQLite and scheduler, not provider connectivity

Application bearer (NYLORUN_SERVER_KEY)

MethodPathNotes
PUT/v1/agents/:agentIdrequestId, complete manifest, implementationVersion, optional pluginRoots
GET/v1/agentsSaved definitions
PUT/v1/sessions/:sessionIdagentId, trusted ownerUserId, optional info, vaultIds, credentialSelections
GET/v1/sessions/:sessionIdStatus, waits, MCP snapshot, pending actions
GET/v1/sessionsOptional ?agentId=
POST/v1/sessions/:sessionId/commandsSessionCommand
GET/v1/sessions/:sessionId/items?cursor= and optional ?agent= (delegationId or path)
GET/v1/sessions/:sessionId/eventsSSE; cursor or Last-Event-ID
POST/GET/DELETE/v1/vaults and /v1/vaults/:vaultId/credentialsMetadata only on read
GET/PUT/v1/host/modelNever returns the secret
PUT/v1/host/model/selectionSwitch active provider/model
GET/v1/host/providersConfigured providers
GET/v1/host/modelsPublic catalog
GET/v1/host/sandboxSelected sandbox backend
PUT/GET/v1/executorsRegister/list; tokens never listed
DELETE/v1/executors/:agentId409 if from NYLORUN_EXECUTORS_JSON

Executor bearer

MethodPathNotes
GET/v1/executors/connectSSE work_available
GET/v1/actionsPending actions for scoped agentId
POST/v1/actions/:actionId/claim{ requestId, implementationVersion }
POST/v1/actions/:actionId/heartbeatLease renewal
POST/v1/sessions/:id/commandsaction_result only

Executor credentials cannot call vault, host model, or executor admin routes. A stored manifestHash is ignored. Subscribe before discovery; notifications never authorize execution.

Command idempotency keys bind to canonical request content within a session; requestId is excluded from comparison.

Guides: Deploy, Host Runtime.

On this page