Skip to content

Warlock.js

Full-stack TypeScript framework · v5.3.1

Build the whole product without leaving TypeScript.

Server-rendered React, typed HTTP and data, and production-ready AI agents — all on one application lifecycle. Start full-stack, then compose only the packages you need.

28 published packages v5.3.1 current release MIT licensed

[ One app, every surface ]

Pages, APIs, and agents belong together

Render React on the server, expose typed HTTP routes, and give agents the same application capabilities — inside one lifecycle and one codebase.

SSR page src/web/products/index.page.tsx
import type { PageLoader, PageProps } from "@warlock.js/web";
import { catalog } from "app/products/catalog";
import ProductGrid from "./product-grid";
export const loader = (async () => ({
products: await catalog.list(),
})) satisfies PageLoader;
export default function Products({ data }: PageProps<typeof loader>) {
return <ProductGrid items={data.products} />;
}

A typed loader feeds the same React component on the server and in the browser. Routing, metadata, layouts, hydration, and navigation live in web.

HTTP API src/app/products/routes.ts
import { router } from "@warlock.js/core";
import { createProduct, listProducts, showProduct } from "./controllers";
router.get("/api/products", listProducts);
router.post("/api/products", createProduct);
router.get("/api/products/:id", showProduct);

One line registers an endpoint. Controllers, validation, response helpers, middleware, and module conventions live in core.

AI agent src/app/support/agents/triage.ts
import { ai } from "@warlock.js/ai";
import { openai } from "./providers";
export const supportAgent = ai.agent({
model: openai.model({ name: "gpt-4o-mini" }),
systemPrompt: "Help customers choose a product.",
});
export function recommendProduct(prompt: string) {
return supportAgent.execute(prompt);
}

Pick a provider and define an agent beside the rest of the app. Tools, retries, structured output, workflows, and middleware live in ai.

[ Why Warlock ]

One application, one mental model

Browser UI, server logic, data, and agents compose through the same typed modules instead of meeting across framework seams.

01

UI and server, one application

Server-rendered React pages boot inside the same Warlock lifecycle as routes, modules, middleware, and services — no second app to stitch together.

02

Typed end to end

Seal schemas are validation, TypeScript types, and JSON schema at once. Define a shape once; it holds at the edge, in the compiler, and in tool calls.

03

One backend for people and agents

Pages, HTTP endpoints, and AI tools can call the same domain code. Add a new surface without rebuilding the product behind it.

04

Full-stack, still modular

Start with Core and Web, then add Cascade, cache, auth, queues, or AI only when the product reaches for them. Every package remains independently installable.

[ What's in the box ]

A package for every layer of the product

Start with a full-stack app, then compose the data, security, and AI capabilities it needs.

Core

The HTTP backbone.

Routing, modules, middleware, mail, and file storage — with the conventions every Warlock app is built on.

Web

SSR React, built in.

Filesystem pages, layouts, typed loaders, metadata, hydration, and client navigation — inside Warlock's application lifecycle.

Cascade

Typed database ORM.

Models with relations and migrations, atomic operations, and built-in vector search — all fully typed.

Auth & Access

Identity and permissions.

Tokens, route protection, and custom user types — plus RBAC checks and ABAC policies when you need them.

Seal

One schema, three jobs.

Validation that doubles as TypeScript types and JSON schema — define a shape once and reuse it everywhere.

AI

Agents on the same stack.

Typed agents, tools, workflows, supervisors, orchestrators, a planner, and memory — five provider adapters and built-in observability behind one API.

28
Published packages
Pick what you need
841
Documentation pages across all versions
Written & verified
15
Documented topics
Latest editorial map
v5.3.1
Current release
Derived from the changelog

[ AI-native ]

A first-class AI layer, not a plugin

Typed agents, workflows, supervisors, orchestrators, a self-directed planner, and memory — all behaving like everything else you write. Swap the model provider without touching your agent code.

  • Typed agents & tools Inputs and outputs are typed; structured output is validated, not parsed by hope.
  • Workflows & supervisors Compose agents into multi-step workflows, with a supervisor routing the work.
  • Stateful orchestrators Multi-turn sessions with durable state, resume, and compaction — plus working and semantic memory.
  • Self-directed planner Hand the agent a goal and a toolbox; it generates its own plan and runs it.
  • Built-in observability Trace every run and export to OpenTelemetry or Langfuse with Panoptic.
  • Same envelope Retries, middleware, and errors behave exactly like the rest of the framework.

[ Pick your path ]

Three ways to start

Start with the surface your product needs today. Every path joins the same application when you add the next one.

[ Ship it ]

Ready to build the whole thing?

Scaffold once. Add a page, an API, and an agent as your product grows — the same TypeScript application all the way down.