@agentai-tbl/contracts
v0.12.0
Published
TypeScript/Zod bindings for the Agent AI HTTP contract. The package is built from the `contracts/openapi.json` snapshot, published to npm, and exposes:
Downloads
21
Readme
@agentai-tbl/contracts
TypeScript/Zod bindings for the Agent AI HTTP contract. The package is built from the
contracts/openapi.json snapshot, published to npm, and exposes:
main→dist/index.js(CommonJS bundle generated fromsrc/index.ts)types→dist/index.d.ts(full TypeScript definitions that mirror the exported Zod schemas)
See CHANGELOG.md for contract history and grab raw OpenAPI snapshots from the GitHub Actions artifacts on api-v* tags if you need to inspect past releases.
Building
pnpm install
pnpm run preparepnpm run prepare regenerates the schemas from the OpenAPI snapshot and compiles the
package so the dist/ artifacts referenced by main/types are ready for linking
into downstream consumers.
Usage
import { Core, Nutrition } from "@agentai-tbl/contracts";
const requestSchema = Nutrition.NutritionRequestSchema;Server-first release workflow
- The FastAPI backend is the source of truth for the API contract. When the OpenAPI snapshot changes, bump the package version and publish a new tag so downstream consumers can pick up the update via npm.
- WebUI/frontend consumers must depend on the published package from npmjs; do not vendor local snapshots.
- Ship frontend changes only after the refreshed package has been published so generated types stay in lockstep with the backend contract.
Installing from npm
Use the standard pnpm install flow to pull the latest published bundle:
pnpm add @agentai-tbl/contractsThe files allowlist in package.json keeps the published tarball limited to
dist/, package.json, and this README so installs stay lean while still
delivering the artifacts referenced by main/types.
