@opencall/types
v0.1.3
Published
OpenCALL canonical Zod schemas and types for the request/response envelope, registry, and error contract
Downloads
535
Maintainers
Readme
@opencall/types
Docs: https://opencall-api.com (human-readable). AI agents may prefer raw markdown at
/spec— GitHub blocks most non-Copilot bots.
The canonical Zod schemas and TypeScript types for the OpenCALL request/response envelope, operation registry, and error contract.
@opencall/types is the source of truth for the wire-level OpenCALL contract in TypeScript. Both @opencall/server and @opencall/client (forthcoming) depend on it.
Install
npm install @opencall/types
# or
bun add @opencall/typesSurface
RequestEnvelopeSchema— Zod schema for the body ofPOST /call.RequestEnvelope— TypeScript type,z.infer<typeof RequestEnvelopeSchema>.ResponseEnvelope,ResponseState— canonical response envelope shape.OperationModule,OperationResult— the contract that operation handlers implement.RegistryEntry,RegistryResponse— the shape served at/.well-known/ops.DomainError,BackendUnavailableError— throwable error classes.domainError,protocolError— response-shape constructors.
Quick example
import { RequestEnvelopeSchema, type RequestEnvelope } from "@opencall/types"
const parse = RequestEnvelopeSchema.safeParse(rawBody)
if (!parse.success) {
// ... return 400
}
const envelope: RequestEnvelope = parse.dataOpenCALL spec compatibility
This package targets OpenCALL spec callVersion: 2026-02-10. See the canonical site for spec history and migration notes.
License
Apache-2.0
