Skip to content

Introduction

jevlish brings Jev judgments into ordinary TypeScript business logic. Use given to judge one value and from to filter or rank a collection.

The official Jev SDK is shaped like an LLM SDK: build a request, send it, and read the response. That is useful when the response goes to a person. In application logic, the response usually decides what code does with a value it already has—whether a ticket escalates, which rows a query keeps, or who gets assigned.

jevlish expresses those operations as conditions, filters, rankings, and choices. Exact checks remain TypeScript functions. Semantic checks remain plain-language Jev questions.

  1. given, from, and the question builders create a lazy expression. Building it sends nothing.
  2. .plan() shows the state and questions that would leave the process.
  3. await or .run() folds code predicates, compiles the remaining Noul, Score, and Choice questions, and asks Jev.
  4. The acceptance policy turns model probabilities and confidences into decided or uncertain judgments.
  5. The result retains the requests, answers, local predicate outcomes, usage, cache status, and policy as evidence.
judge one thing
import { given, means } from "jevlish";
import { escalate, leave, review, ticket, type Ticket } from "./support.js";
const blocked = means<Ticket>("the customer cannot complete their task")
.excluding("they can finish the task despite the inconvenience");
const isOpen = (ticket: Ticket) => ticket.status === "open";
const decision = await given(ticket)
.seenAs((t) => ({ subject: t.subject, body: t.body }))
.when(blocked)
.and(isOpen)
.do(escalate)
.otherwise(leave)
.whenUncertain(review);
decision.branch; // "do" | "otherwise" | "uncertain"

means(...) defines a reusable Noul question with an explicit boundary. given(ticket) supplies the subject. .seenAs(...) controls what leaves the process; predicates and handlers still receive the complete Ticket.

The branch has three outcomes. do handles true, otherwise handles false, and whenUncertain handles an answer that did not meet the policy. A false code predicate under and settles the condition locally, so a closed ticket sends no request.

  • A string condition or means(...) compiles to a Jev Noul question.
  • A scale compiles to a Score question.
  • chooseFrom compiles to a Choice question and maps the answer back to one of your objects.
  • ask sends related Noul, Score, and Choice questions about one subject together.
  • A Sense is a configured set of given, from, and grade verbs bound to one runtime.

Jevlish uses the TypeSafe/Jev SDK. That is why the environment variable is TYPESAFE_API_KEY and the default transport is TypeSafeClient.