jev-state
Dependency-free TypeScript library that converts raw app and game state into labelled bands and pruned lists that Jev reads reliably.
Overview
jev-state is a preprocessing library for Jev inputs. The README lists Jev's documented weak spots: it reads numbers as text and cannot compare or divide them reliably, cannot count, struggles with mixed-format and relative dates, and loses accuracy as irrelevant state piles up. jev-state handles those parts in code before the state reaches Jev, with helpers such as band (hp 38/250 becomes critical), count (ammo becomes few or several), time (epoch timestamps become less than a minute ago), prune (keep chosen fields, sort and cap lists) and project (apply a schema and drop unknown fields). It can also map pick() choices back to items.
It targets game and application developers using Jev for NPC behaviour or app decisions. The library never calls the API and has no runtime dependencies; you pass its output to @typesafe-ai/sdk as usual. A listing reports that on 70 NPC scenarios accuracy went from 74% to 100% with 43% fewer tokens.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Example: which action should the NPC take given its banded state?(inferred) | — |
How it works
- Describe raw state once with band, count, time and prune helpers
- project() converts and drops unknown fields
- Pass resulting state to the TypeSafe SDK
- Map the returned choice back to the original item
Strengths
- Works around Jev's documented weaknesses with numbers, counting and dates
- Fewer tokens by pruning irrelevant fields
- No runtime dependencies; ESM, CommonJS and types
- Listing reports 74% to 100% accuracy on 70 NPC scenarios
Caveats
- Thresholds and labels are chosen by you and need tuning
- Does not call the API itself; you still need the SDK and a key
Getting started
npm install jev-state @typesafe-ai/sdk (Node.js 22+).At a glance
- Type
- App
- Status
- beta
- Language
- TypeScript
- Runtime
- Node
- Has code
- yes
- Has tests
- yes
Use cases and integrations
How curated lists describe it
Turn raw app and game state into state Jev reads well.
wh000wh000/awesome-jev-liveTurns raw app and game state into labels Jev reads well (hp 38/250 -> "critical", timestamps -> "less than a minute ago", counts -> "a few"), prunes the rest, and maps pick() choices back to items; on 70 NPC scenarios accuracy went from 74% to 100% with 43% fewer tokens.
hellogumbo/awesome-jev
Frequently asked questions
Why preprocess state for Jev?
Because Jev reads numbers as text, cannot count and handles relative dates poorly, so code should turn them into labels first.
Does jev-state call TypeSafe?
No. It only transforms state; you send it with @typesafe-ai/sdk.
What improvement is reported?
A listing reports NPC scenario accuracy rising from 74% to 100% with 43% fewer tokens.
Related projects
Dependency-free CLI and Codex skill that send local state to Jev for typed judgments and return answers without echoing the state.
Agent skillbetaPythonTypeSafe SDK for the Godot 4.7 game engine, described as at parity with the Python SDK and HTTP API.
LibraryGDScriptMoonBit client for Jev with a CLI and a Jev-versus-Jev gomoku match, plus a tool turning timed game logs into GIFs.
LibraryprototypeMoonBitHack Club's lightweight LLM proxy, listed for adding a Jev forwarding endpoint behind its auth, limits and usage logging.
MCP serverproductionTypeScriptAx, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.
PluginproductionTypeScriptEffect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.
ProjectproductionTypeScript