@demystify/tools-sdk
v0.1.0
Published
Typed browser/Node client for the Demystify Tools REST API — one call per bound tool, validated against the same zod I/O.
Maintainers
Readme
@demystify/tools-sdk
A tiny, typed client for the Demystify Tools REST
API. One run(tool, input) per bound tool, with input typed and validated against the
same zod schema the server uses — so a bad call fails locally, before a round-trip.
import { DemystifyTools } from "@demystify/tools-sdk";
const tools = new DemystifyTools(); // defaults to the public API
const gst = await tools.run("gst-calculator", { // input is fully typed
amountPaise: 100000,
rate: 18,
});
// gst.totalPaise === 118000 (money is integer paise)
tools.tools(); // ids callable over the API- Typed:
run(id, input)infersinputfrom the tool's zod schema; unknown ids and bad inputs are compile-time and run-time errors. - Fails fast: input is zod-validated locally by default (
{ validate: false }to skip). - Errors: non-2xx responses throw
ToolApiErrorcarrying the RFC-9457 problem body. - Portable: pass
{ fetch }for Node < 18 or a proxy;{ baseUrl }to point elsewhere (e.g. your own self-hosted runner).
Only the pure lane is callable over the anonymous API; tools that need a browser canvas,
an AI key, or network egress return 501 (run those in the browser or your own runner).
Status
Pre-1.0, versioned but not yet published — see the repo's docs/verification/user-actions.md.
