dimon-83/mbel/playground/web does not have a README file

    LimitsRequest

    type LimitsRequest

    A limits request parsed from JSON. Absent keys keep the compiled default; allowRaise opts into raising a budget above that default.

    Session

    type Session

    A live session: the prepared instance plus the metadata hosts need to introspect it. signatures is the resolved (name, params) list in definition order (params explicit or auto-extracted).

    UserFnSpec

    type UserFnSpec

    A user function parsed from a functions file (format v1).

    abi_layout

    fn abi_layout() -> String

    The C-ABI string layout, as a small JSON document. A String argument and a String return are both a pointer to UTF-16LE code units with a u32 character count immediately before the pointer and a 0x0000 terminator after the payload:

    [ u32 char_count ][ utf16le code units ][ 0x0000 ] ^ pointer passed across the ABI

    headerOffset is the count's offset from the pointer (negative: before it), terminator is the terminator width in bytes. check_abi.mjs --cabi fails when this drifts from what the artifact actually does.

    configure_session

    fn configure_session(handle : String, limits_json : String) -> String

    Tightens a live session's budgets. Only lowering is allowed: without allowRaise, a request above the compiled default (or 0, which disables a guard) is rejected, so a misconfiguration cannot silently remove the DoS protection.

    create_session

    fn create_session(funcs_json : String, mode : String, engine : String, defaults_json : String) -> String

    Creates a session from a functions file (format v1).

    mode is "eval" (standard, dynamic — default semantics), "checked" (standard, bodies type-checked at registration, calls arity-checked) or "legacy" (classic dialect); anything else is MODE_UNKNOWN. engine is "walk" or "vm"; anything else is ENGINE_UNKNOWN. defaults_json is an optional JSON object supplying fallback bindings for parameters the caller does not pass (empty string or "null" for none) — it plays the role the evaluation env plays in eval_with_functions.

    Creation is atomic: on any validation error nothing is registered and no handle is consumed.

    describe_abi

    fn describe_abi() -> String

    The machine-readable ABI manifest: abiVersion, engineVersion, the artifact list with per-artifact host requirements, every export with its parameter names, the error envelope shape, the stable error-code vocabulary, the default budgets and the live-session cap.

    describe_functions

    fn describe_functions(funcs_json : String) -> String

    Validates a functions file and returns the resolved signature list [{"name":...,"params":[...],"description":...}] — params are the explicit list or auto-extracted from the body (first-appearance order). Page-facing: used to render the function chips.

    describe_session

    fn describe_session(handle : String) -> String

    describe_session(handle) — mode, engine, resolved signatures and the instance's live budgets.

    disassemble

    fn disassemble(source : String, _env : String) -> String

    VM bytecode listing for the expr front end — the same lowering the Vm engine executes, after constant folding. The env argument is unused but kept so all page entry points share one JS signature.

    dump_ast

    fn dump_ast(source : String) -> String

    expr front-end parse-tree dump (the ENode debug representation).

    eval_checked

    fn eval_checked(expr : String, env : String, engine : String) -> String

    Standard dialect, Compile mode — static checker errors.

    eval_expr

    fn eval_expr(expr : String, env : String, engine : String) -> String

    Standard dialect, Eval mode — dynamic typed runtime errors.

    eval_jexl

    fn eval_jexl(expr : String, env : String, engine : String) -> String

    Classic dialect (JS semantics) — the locked-corpus entry.

    eval_session

    fn eval_session(handle : String, expr : String, env : String) -> String

    Evaluates an expression against a session. The env is per call (it is the data, not the registration); parameter defaults were bound at creation time.

    eval_with_functions

    fn eval_with_functions(expr : String, env : String, funcs_json : String, mode : String, engine : String) -> String

    Evaluates with user functions loaded from a functions file (format v1). mode selects the dialect entry — "eval" (standard, default), "checked" (standard, strict), "legacy" (classic); engine selects "walk" (default) or "vm". The evaluation env doubles as the functions' default bindings: unpassed parameters fall back to same-named env keys, explicit arguments win. In "checked" mode the bodies are type-checked at registration (lexical params, complete symbol table) and the expression's calls are checked against the registered arities. All failures (file format, registration, evaluation) return {"$error": "..."}.

    eval_with_limits

    fn eval_with_limits(expr : String, env : String, engine : String, limits_json : String) -> String

    eval_with_limits(expr, env, engine, limits_json) — the stateless entry with per-call budgets. Same semantics as eval_expr; the instance lives only for this call.

    release_session

    fn release_session(handle : String) -> String

    Releases a handle. Idempotent in the sense that the instance keeps working afterwards — only the handle is gone, so a second release (or an eval) reports HANDLE_UNKNOWN.