Vibe.Eval (vibe v0.2.0)

Copy Markdown View Source

Runtime Elixir evaluation with captured IO, timeouts, and session state.

Eval is Vibe's main control plane for agents. The model-facing eval tool can call ordinary Elixir APIs inside the running Vibe VM, which keeps the external tool surface small while still exposing commands, telemetry, storage, plugins, sessions, subagents, AST, and LSP helpers.

Use run/2 when evaluation should persist variables, aliases, imports, and requires for a session. Use once/2 for one-off in-process evaluation that should not keep state. Eval sessions preload aliases such as Cmd for Vibe.Command and MD for Vibe.MD.

Summary

Types

result()

@type result() :: {:ok, Vibe.Eval.Result.t()} | {:error, String.t()}

Functions

bindings(session_id)

@spec bindings(String.t()) ::
  {:ok, [Vibe.Eval.Evaluator.binding_info()]} | {:error, String.t()}

cancel(session_id)

@spec cancel(String.t()) :: :ok

forget(session_id, names)

@spec forget(String.t(), [atom() | String.t()] | atom() | String.t()) ::
  :ok | {:error, String.t()}

once(code, opts \\ [])

@spec once(
  String.t(),
  keyword()
) :: result()

reset(session_id)

@spec reset(String.t()) :: :ok | {:error, String.t()}

run(code, opts)

@spec run(
  String.t(),
  keyword()
) :: result()