TypeScript SDK
Use @stacklok-oss/mecatl-sdk to create sessions, run agents, handle approvals,
follow durable activity, and call the rest of the Mecatl API from TypeScript.
The package supports Node.js, Bun, Deno, and browser applications.
Start with Use the TypeScript SDK to run one prompt against a private offline daemon.
Choose a workflow
- Connect an application to use an operator-owned daemon from Node.js, Bun, Deno, or a browser.
- Run a private local daemon when a Node.js, Bun, or Deno
process should own
mecated, or when a script needs onequery()call. - Work with sessions and runs to stream events, receive a terminal result, send controls, or include media in a prompt.
- Handle permissions and plans to resolve asks in application code and continue an approved plan.
- Resume durable activity to follow one run or a session's cross-run timeline from an application-owned cursor.
- Register callback tools to expose local Node.js or Bun handlers to sessions created by a private daemon.
- Inspect a server before creating a session to check compatibility, deployment capabilities, and safe build identity.
- Enroll MCP workspace services to inspect a session's connector inventory and drive whole-bundle enrollment.
The SDK also exposes typed namespaces for models, agents, skills, teams, schedules, learning, MCP inventory, and storage operations. See the TypeScript SDK API reference for the complete API.
On a gRPC session, guardrailCoverage() reads effective checker status and
guardrailReviewDetail(reviewId) retrieves owner-authorized live review detail.
HTTP connections raise UnsupportedFeatureError for these methods because the
server exposes no HTTP routes. See
Permissions and posture
for guardrail behavior.
Workflow ownership
The server validates requests and owns session state, permissions, and MCP authorization outcomes. The SDK sends session-bound requests, returns typed results, and follows event streams. Your application chooses what to display and when to act, including opening a browser, rechecking authorization status, and saving local preferences.
Use the session guide for inspection, mutation, and successor sessions; server discovery before creating one; MCP connector enrollment for workspace services; and MCP authorization continuation for a parked run. The runnable SDK examples show these workflows from package exports.
Package entry points
| Import | Use it for |
|---|---|
@stacklok-oss/mecatl-sdk | Deno and browser HTTP and SSE connections, injected transports, and transport-neutral types. |
@stacklok-oss/mecatl-sdk/node | Node.js and Bun gRPC connections, local daemons, one-shot queries, filesystem media helpers, and callback tools. |
@stacklok-oss/mecatl-sdk/deno | Deno gRPC connections, Deno.Command local daemons, and one-shot queries. |
@stacklok-oss/mecatl-sdk/gen | Generated protobuf-es messages and service descriptors for low-level calls and typed namespace requests. |