swift-jev
Swift library and CLI for Jev with enum-typed Choice, Noul and Score questions, plus an agent skill for coding agents.
Overview
swift-jev is a Swift library and command-line tool for TypeSafe's Jev. In the library, Choice questions are typed by Swift enums that conform to JevChoiceOptions with option descriptions, Noul questions can describe what true and false mean, and Score questions take ordered levels. A result builder sends all questions in one request; responses are read with require(question) returning the enum value or probability, plus confidence, per-option probabilities and an estimated cost. It needs Swift 6.2, supports Apple platforms (Linux is declared but not covered by CI), and has no dependencies.
The CLI takes a JSON request on a file or stdin and writes only the JSON response to stdout, validating questions before sending and accepting the key from the environment or a key file, never from arguments. A bundled Jev skill teaches coding agents (Codex, Claude Code, Cursor, GitHub Copilot and others) how to prepare a request and interpret the response, installable with npx skills add. Custom compatible endpoints are supported.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Which team should handle this customer inquiry? | billing · technical · sales · account |
| Yes / no | Does this inquiry need to be handled today? | — |
| Score | How frustrated is the customer? | Calm and factual · Visibly annoyed · Angry, threatening to leave |
How it works
- Declare questions with Swift types
- client.evaluate(state:) with a result builder
- Read typed answers, confidence and cost
- Or call the jev CLI with JSON from a script or agent
Strengths
- Compile-time typed options via enums
- No dependencies
- CLI and agent skill for coding agents
Caveats
- Linux untested
- Requires Swift 6.2
Getting started
.package(url: "https://github.com/d-date/swift-jev", from: "1.0.0"), or swift run jev --input request.json with TYPESAFE_API_KEY set.At a glance
- Type
- CLI
- Status
- production
- Language
- Swift
- Runtime
- Swift library + CLI
- Has code
- yes
- Has tests
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
A Swift client for TypeSafe AI's Jev — typed judgements, not text
logicrw/awesome-jev-projectsA Swift client for TypeSafe AI's Jev — typed judgements, not text.
hellogumbo/awesome-jevSwift library and CLI for the three primitives.
MrJev/awesome-jev
Frequently asked questions
How are choices typed?
As Swift enums conforming to JevChoiceOptions, so answers come back as enum values.
Can coding agents use it?
Yes, via the CLI and a bundled Jev skill.
Where does the key come from?
TYPESAFE_API_KEY or a key file, never from arguments or request JSON.
Related projects
Unofficial hosted or local Jev MCP server giving agents a quick second opinion: it picks yes/no, scale or choice and returns probabilities.
MCP serverbetaTypeScriptPython MCP server wrapping Jev as classify, score, check, match and screen tools with confidence on every answer.
MCP serverbetaPythonPython decision gateway and stdio MCP server exposing Jev via OpenRouter's alpha Decisions endpoint to Claude Code, Codex and Cursor.
MCP serverbetaPythonAgent skill and CLI that converts plain requirements, LLM prompts or prompt-calling code into a typed Jev request and runnable script.
Agent skillbetaPythonGo MCP server giving any client typed Jev decisions via OpenRouter or TypeSafe, with validated answers and no paid retries.
MCP serverproductionGoGo CLI and single-binary MCP server giving Claude Code, Codex, Hermes and pi an evaluate tool backed by Jev, d1, CLM or Laya.
MCP serverbetaGo