@personaai/runtimev0.11.0
runtime v0.11.0

@personaai/runtime 0.11.0

Framework-agnostic runtime engine — the shared brain every adapter wraps

@personaai/runtime 0.11.0

Framework-agnostic runtime engine. Adapters (@personaai/adapters/express, nextjs/server, nestjs) are thin translators over this.

Server-side only. Holds PERSONA_CREDENTIAL — never bundle.

Install

bash
npm install @personaai/runtime

If you use Express/Next/Nest, install @personaai/adapters instead — it wraps this.

The sacred contract: resolveUser

Persona never authenticates users. You tell the runtime who the request is from:

ts
import { createRuntime } from '@personaai/runtime';
const runtime = createRuntime({  baseUrl: process.env.PERSONA_BASE_URL!,  credential: process.env.PERSONA_CREDENTIAL!,  resolveUser: async (request) => {    return getUserIdFromSession(request.headers['cookie']); // your auth  },});

resolveUser returns string | null — null/throw → runtime responds 401. See .

Quickstart (raw Node)

ts
import { createServer } from 'node:http';import { createRuntime } from '@personaai/runtime';import { toNodeHandler } from './node-handler.js'; // copy from sdk/runtime/examples/node-handler.ts
const runtime = createRuntime({  baseUrl: process.env.PERSONA_BASE_URL!,  credential: process.env.PERSONA_CREDENTIAL!,  resolveUser: (req) => req.headers['x-demo-user-id'] ?? null,});
createServer(toNodeHandler(runtime)).listen(3210);

For framework installs, see .

Capabilities (opt-in, default off)

CapabilityRoutes
agentsWriteFull Agent CRUD beyond GET /agents
mcpsMCP CRUD + test/readResource/callTool
providersLLM providers (holds API keys)
skillsSkill authoring
knowledgeKnowledge CRUD + upload/search
storesStores + file read/write
auditLogsAudit log read
architectArchitect co-pilot POST /architect
workflowsWriteWorkflow CRUD + draft/versions/mermaid

Disabled capabilities' routes are absent (404/405), not 403. See .

Routes

Core always-on routes: see . Capability-gated routes: see .