jod
TypeScript library that binds a state schema and Jev questions into one artifact, validating state locally before asking for typed answers.
Overview
jod brings semantic schemas to TypeScript. Zod validates data you already understand; Jev judges data you do not; jod joins the two. You define a state schema (Zod or any Standard Schema library) and a set of choice, score and noul questions in one semantics() artifact. Calling ask() validates the state locally and for free, and only then sends every question in one parallel Jev request; an invalid state raises an error and no request is made.
Answers come back projected into domain values: a union of your option ids for choice, a number for score, a boolean for noul, with per-question confidence available. It is built on the official @typesafe-ai/sdk and re-exports its primitives, retries, timeouts, logging and error types, adding only validation, projection and test fixtures. It is aimed at TypeScript developers who want type-safe Jev calls in application code, such as support triage.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Which team should handle `message`? | billing · technical · account |
| Yes / no | Does `message` explicitly ask for money back? | — |
| Score | How frustrated does the customer appear in `message`? | Calm and matter-of-fact · Frustrated but civil · Very angry, or threatening to leave |
How it works
- Define a state schema and questions with semantics()
- Call ask(state)
- State is validated locally; invalid state makes no request
- Questions go to Jev in one request
- Answers are projected into typed values with confidence
Strengths
- No API spend on invalid input
- Typed results matching your option ids
- Reuses the official SDK's retries and errors
- Fixtures for testing
Caveats
- Requires a TypeSafe key
- Thin layer over the SDK
- Early package
Getting started
pnpm add @mateonunez/jod @typesafe-ai/sdk zod, set TYPESAFE_API_KEY, then define semantics({ state, ask }).At a glance
- Type
- Library
- Status
- beta
- Language
- TypeScript
- Runtime
- Node library
- Has code
- yes
Use cases and integrations
How curated lists describe it
Semantic schemas over TypeSafe's Jev — validate the state locally, then project typed answers.
hellogumbo/awesome-jev
Frequently asked questions
Why validate state first?
So malformed input fails locally and never costs an API call.
Does it replace the official SDK?
No, it wraps it and re-exports its primitives and error types.
Do I have to use Zod?
No, any Standard Schema library works; Zod is an optional peer.
Related projects
Local service to define, test and publish versioned Jev judgment functions, callable over HTTP by backends and over MCP by agents.
MCP serverbetaTypeScriptRuby gem that stores Jev Noul, Choice and Score answers about a record's text as ordinary ActiveRecord columns you can query.
LibrarybetaRubyUnofficial Go client for TypeSafe System One with generics that bind each choice, score and noul answer to a declared Go type.
ProjectbetaGoPython dialect that adds a '~' operator and jev/case blocks so a branch can ask Jev a yes/no, scale or choice question.
ProjectprototypePythonProvider-independent .NET decision engine with a separate TypeSafe Jev provider package mapping Choice, Score and Noul to /v1/systemone.
LibrarybetaC#Elixir/OTP library treating Jev as a peer process whose answers arrive as messages you pattern match in GenServer clauses.
LibrarybetaElixir