Start here · Architecture chooser

Choose an integration layer

Keep your existing architecture. Adopt the lowest Heddle layer that already owns the runtime mechanics your product needs.

Customization depth

Independent levels 1–5

Hosting depth

Independent levels A–F

Documentation status

Canonical reference

Assumptions

  • You know which server, transport, and UI layers your product already owns
  • You want Heddle to own reusable agent mechanics without becoming your application framework
Heddle owns
  • Conversation semantics, tools, traces, artifacts, and approval lifecycle
  • Optional process-local run identity, replay, cancellation, and remote protocol correctness
Your product owns
  • Existing server and client framework choices
  • Identity, authorization, public API, persistence policy, deployment, and UI

Choose by what your host already has

Existing product shapeStart withStatus
Nothing beyond a TypeScript processrunQuickstartConversationCliSupported SDK boundary and runnable example
A local process that needs product tools or MCPQuickstart plus host extensionsRunnable examples
A process that owns output or a local UIcreateConversationEngineSupported SDK boundary
A server, worker, or Electron backend@heddleagent/runtime/runsSupported boundary and runnable service example
Express with REST + SSE@heddleagent/runtime/runs/http-sseSupported helper and runnable Express example
A remote JavaScript client over any transport@heddleagent/run-clientSupported browser-safe protocol package
A browser using the conventional REST/SSE contract@heddleagent/run-client/http-sseSupported helper and runnable client example
A React/Vite productRemote client plus the React referenceRunnable reference, not a React SDK
Fastify, Hono, Nest, tRPC, WebSocket, or IPCHosted service plus a host adapterAdaptation guide
Multi-process or serverless active runsHosted service plus shared routing or deliveryArchitecture guidance
A backend in any language invoking a separate compatible Execution Host@heddleagent/execution-host-client in TypeScript, or the canonical v1 artifactsStable client package; compatible host remains private research

Customization and hosting are different decisions

The root @heddleagent/runtime package exposes a progressive customization ladder:

  1. stand up a persisted conversation;
  2. add tools, MCP, and capability-specific context;
  3. shape output and consume results;
  4. own sessions, approvals, and lifecycle;
  5. inject production session and artifact storage.

Hosting is an optional second axis. Add /runs only when execution must be independently addressable, cancellable, or reconnectable. Add the run-client package only when events cross a transport boundary.

Entry-point boundaries

ImportAssumption it adds
@heddleagent/runtimeA Node host wants the curated conversation SDK
@heddleagent/runtime/runsOne long-lived process owns active runs and bounded replay
@heddleagent/runtime/runs/http-sseThe host chose conventional Node HTTP/SSE framing
@heddleagent/run-clientA JavaScript client consumes validated run envelopes
@heddleagent/run-client/http-sseThat client chose the conventional REST/SSE resource
@heddleagent/execution-host-clientA product control plane invokes a separate compatible Execution Host; only the host imports Heddle
@heddleagent/runtime/advancedA Node host needs lower-level runtime assembly

The advanced entrypoint does not implicitly opt into hosting or remote transport.

Stop at the neutral boundary

For tRPC, Fastify, Hono, Nest, WebSocket, Electron IPC, or queues, stop at the transport-neutral run service and implement the adapter inside the framework your product already uses. Preserve stable run identity, ordered sequences, cursor replay, explicit cancellation, and exactly one terminal event.

Continue to Responsibility boundary before implementation, or start the first-agent tutorial if you are evaluating from scratch.

Canonical sources