Skip to main content

TypeScript SDK API reference

@stacklok-oss/mecatl-sdk provides browser, Node.js, Bun, and Deno clients. The package is ESM-only.

Entry points

Entry pointRuntimeContents
@stacklok-oss/mecatl-sdkBrowsers and shared runtimesHTTP and SSE transport, clients, sessions, runs, events, durable activity, and shared types.
@stacklok-oss/mecatl-sdk/nodeNode.js and BungRPC transport, local daemon management, one-shot queries, filesystem media helpers, callback tools, and the core API.
@stacklok-oss/mecatl-sdk/denoDenogRPC over TCP, TLS, or Unix sockets, Deno.Command local daemon management, one-shot queries, and the core API.
@stacklok-oss/mecatl-sdk/genAll runtimesGenerated protobuf-es messages and service descriptors. See the gRPC API reference for the service contract.

Runtime support

RuntimeVersionSupport
Node.js22 or laterRemote connections on macOS, Linux, and Windows. Local daemon management on macOS and Linux.
Bun1.4 or laterRemote connections and local daemon management on macOS and Linux.
Deno2.9.3 or later in the 2.x lineRemote connections and local daemon management on macOS and Linux.
BrowsersLatest two stable Chrome, Firefox, and Safari releasesHTTP and SSE through a same-origin backend-for-frontend.
TypeScript5.7 or laterPublished declarations. The SDK is developed with TypeScript 6.

Error model

SDK failures extend MecatlError. Each failure includes a machine-readable code, an origin, and any available transport metadata.

Terminal run outcomes declared by the server, including cancellation and limits, resolve as RunResult values. Transport, protocol, authentication, and invalid local lifecycle failures throw.