@ethosagent/web-contracts
v0.3.11
Published
Typed oRPC contract and Zod schemas for the Ethos web API
Maintainers
Readme
@ethosagent/web-contracts
Typed oRPC contract and Zod schemas for the Ethos web API.
This package defines the wire-format schemas and typed contract that both the Ethos web API server and @ethosagent/sdk consume. Use it directly if you need schema validation or want to build a custom client.
Installation
npm install @ethosagent/web-contractsUsage
import { contract, SessionSchema, PersonalitySchema } from '@ethosagent/web-contracts';
// Use Zod schemas for validation
const session = SessionSchema.parse(rawData);
// Use the oRPC contract for typed API definitions
// The contract object defines every route with input/output schemasWhat's included
- Zod schemas for all API wire types (sessions, personalities, kanban, memory, etc.)
- oRPC contract defining every API route with typed inputs and outputs
- TypeScript types inferred from schemas via
z.infer
Related
@ethosagent/sdk-- high-level client SDK built on these contracts- Ethos documentation
