jevascript
esc

    Type to search · ↑↓ to move · ↵ to open

    Get started

    Getting started

    Introduction

    jevascript is a semantic runtime for TypeScript. It adds is, score and choose next to string, number and boolean, so judgements that do not come from a property can still be ordinary values in ordinary control flow.

    triage.ts
    import { semantic } from "jevascript"
    
    const urgency = await semantic(ticket)
      .score("A human needs to act on this urgently.")
    
    if (urgency > 80) {
      pageOnCall()
    }

    The model supplies the judgement. Your code decides the consequence.

    What it is#

    Ordinary code can test what a value contains: ticket.plan === "enterprise", amount > 1000. It cannot test what a value means: whether a ticket is urgent, whether a comment is passive-aggressive, whether two bug reports describe the same bug.

    jevascript makes those judgements values too. Three primitives cover every shape a judgement can take:

    PrimitiveReturnsAsk it for
    is(proposition)booleanWhether a claim holds
    score(criterion)numberHow strongly a claim holds, on a range you choose
    choose(options)one of the optionsWhich of a fixed set fits best

    They are backed by a decision model: a model that scores propositions and returns calibrated probabilities. It generates no text, so there is no prompt to hijack and nothing to parse. Every question created in the same synchronous turn travels in one request, so seven questions cost about as much as one.

    Where to start#

    What it is not#

    • Not an LLM SDK. There is no completion, no chat, no streaming. The provider returns probabilities, not prose.
    • Not an agent framework. Nothing plans or loops. You write the if.
    • Not a security boundary. Authentication, authorisation and exact validation stay deterministic. See Not a security boundary.
    • Not a calculator. Counting, arithmetic and date comparison stay in code. A decision model reads numbers as text.

    Status#

    Version 0.1.x. The public API may change before 1.0; every change is listed in the changelog. The package has no runtime dependencies and needs Node 22.6 or newer.