Overview

Write durable agents in TypeScript: @duraton/sdk authors workflows, runs a runner, and calls Duraton from app code, all from one package.

@duraton/sdk is how you author workflows, run them on a runner, and talk to Duraton from app code. Install it and import from the package root:

npm install @duraton/sdk
import {
  defineWorkflow,
  connect,
  serve,
  register,
  createClient,
  NonRetriableError,
  RetryAfterError,
  PollTimeoutError,
} from "@duraton/sdk";

Entry points

Every export is reachable from the package root. The scoped entries are subsets, for code that should not pull in the rest.

import { createClient } from "@duraton/sdk/client";   // no workflow authoring, no runner
import { createMemoryCache } from "@duraton/sdk/ai";  // the AI ports and their adapters
import { serve } from "@duraton/sdk/hono";            // one framework adapter
EntryContainsUse it when
@duraton/sdkEverything below, plus defineWorkflow, connect, serve, register, hashStepId, and the error types.Authoring workflows and running a runner.
@duraton/sdk/clientcreateClient, DuratonApiError, and the REST DTOs.App code that only calls Duraton - an admin tool, a frontend, a script.
@duraton/sdk/aiThe AIProvider and AICache ports, their adapters, and the AI journal types.Supplying your own model provider or cache store.
@duraton/sdk/bun /hono /elysia /express /fastify /next /nodeOne serve adapter each.Mounting an HTTP runner on that framework.

The surface

Prefer another language? The Python and Go SDKs speak the same connect protocol and cover the same surface - workflows, durable steps, step.ai, and a REST client.

On this page