@mastractl/shared
v0.10.0
Published
Shared error primitives and utilities for the mastractl SDK.
Maintainers
Readme
@mastractl/shared
Shared error primitives and utilities for the mastractl SDK.
⚠ Alpha — API surface may change between 0.7.x releases.
Install
npm install @mastractl/sharedWhat's in here
AppError— typed error class withid,domain,status, anddetails. Used consistently across the REST API; import it to match on specific error IDs in client code.
Usage
import { AppError } from "@mastractl/shared";
try {
await mastractl.agents.heartbeat("my-agent", { userMessage: "hello" });
} catch (err) {
if (err instanceof AppError && err.id === "AGENT_BUDGET_EXCEEDED") {
console.log("budget capped — top up monthly spend limit");
}
}Part of the mastractl SDK
| Package | Purpose |
|---|---|
| @mastractl/shared | Error primitives (this package) |
| @mastractl/agent | AgentSpec types + BYO Mastra Agent adapter |
| @mastractl/client | Typed REST client |
Requires a running mastractl server.